-
Notifications
You must be signed in to change notification settings - Fork 367
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
Allow setting dynamic enable/disable behavior per userscript/userstyle #3315
Comments
Could be a problem for userscripts: |
injectAsStyleElt is also used for addons that need higher specificity then if they were in a file.
|
No. Specificity stays unchanged. |
To avoid the flash of content, I think we should first make sure the style loads, then send the reenabled event to the userscript.
Any examples of addons that could make use of that? |
This gets a bit more tricky if |
ocular. |
Waiting for response by myself |
Ping! There has been no activity for 7 days. |
I think the flashing problem deserves its own "type: bug" issue here |
Note: We also need to consider that currently, the settings page does not distinguish between dynamic and non-dynamic addons. We could possibly create a new manifest property that if set to true, reminds the user to refresh after enabling/disabling (and possibly changing any addon settings), that can be arbitrarily set by the addon author, no matter the actual dynamic-ness of the addon. |
I aim to solve this confusion and properly explain the functioning and purpose of injectAsStyleElt as part of the new userstyle docs: ScratchAddons/website-v2#311 |
Ping! There has been no activity for 7 days. |
Is your request related to a problem? Please describe.
dynamicEnable
,dynamicDisable
,injectAsStyleElt
(is that for faster loading? This one might also need a better name) andupdateUserstylesOnSettingChange
can't have different values for each userscript and userstyle. This is sometimes a problem: for addons that add new UI, it would be helpful to be able to not remove the CSS when it's disabled to prevent flashes when enabling and disabling. It also means that it isn't possible to make an addon that runs on multiple different pages only support dynamic enable/disable on some of them.Describe the solution you'd like
Make them properties of userscript/userstyle objects, not the addon itself.
The text was updated successfully, but these errors were encountered: