Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

userScripts API: re-order without re-registering everything #606

Open
tophf opened this issue May 6, 2024 · 2 comments
Open

userScripts API: re-order without re-registering everything #606

tophf opened this issue May 6, 2024 · 2 comments
Labels
supportive: chrome Supportive from Chrome supportive: firefox Supportive from Firefox supportive: safari Supportive from Safari topic: user scripts

Comments

@tophf
Copy link

tophf commented May 6, 2024

Currently if we want to register a new userscript to run first we need to re-register all existing userscripts. Many users have a lot of userscripts (50-100), some of the popular ones are larger than 1MB and may have hundreds of match patterns, so that seems wasteful, especially if the user wants to re-order multiple scripts in quick succession testing the result each time.

It'd be nice to be able to set the order explicitly e.g. by specifying before: 'id' in the registration options.

  • It's used only during register()/update() to adjust the internal order, i.e. the value is not saved.
  • When multiple scripts in register()/update() specify the same before:
    • should they be grouped after that id in the order they were specified in the list?
    • should it be an error i.e. each before must be unique?
  • A non-existent id should probably result in an error.
@github-actions github-actions bot added needs-triage: chrome Chrome needs to assess this issue for the first time needs-triage: firefox Firefox needs to assess this issue for the first time needs-triage: safari Safari needs to assess this issue for the first time labels May 6, 2024
@kiaraarose kiaraarose added supportive: safari Supportive from Safari and removed needs-triage: safari Safari needs to assess this issue for the first time labels May 9, 2024
@kiaraarose
Copy link

Safari doesn't support the UserScripts API but we agree that it would be nice for developers to have a way to set some priority for these user scripts.

@Rob--W Rob--W added supportive: chrome Supportive from Chrome supportive: firefox Supportive from Firefox and removed needs-triage: chrome Chrome needs to assess this issue for the first time needs-triage: firefox Firefox needs to assess this issue for the first time labels May 9, 2024
@Rob--W
Copy link
Member

Rob--W commented Jul 1, 2024

Note: Chromium has an issue tracking the order of user script execution at https://issues.chromium.org/issues/337078958

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
supportive: chrome Supportive from Chrome supportive: firefox Supportive from Firefox supportive: safari Supportive from Safari topic: user scripts
Projects
None yet
Development

No branches or pull requests

3 participants