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

Scripts ordering #1148

Closed
fagci opened this issue Jul 4, 2022 · 3 comments
Closed

Scripts ordering #1148

fagci opened this issue Jul 4, 2022 · 3 comments

Comments

@fagci
Copy link

fagci commented Jul 4, 2022

Will be nice to have an ability to order scripts to prioritize loading by naming it.

For example:

1. framework
2. plugin
3. plugin
Other script

Just wrote toolbar (script 1) and trying to add buttons (scripts 2, 3) in some order.

For now, solution is to wrap "plugin" scripts with:

window.setTimeout(function() {
//...
}, 42);

where 42 is priority =)

@maggch97
Copy link

maggch97 commented Jul 5, 2022

If you have the order of these scripts, why not merge them into a new script in order?

@fagci
Copy link
Author

fagci commented Jul 5, 2022

Modularity is better.
Small scripts editing is simpler on smartphone than huge.

Also, I think implementing this feature is cheap, but it brings:

  1. organizing "user" scripts
  2. controllable loading order

But your solution will work better, than setting timeouts.

@tuyafeng
Copy link
Owner

I also think you should merge scripts. A script is more like a class than a function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants