New property: dynamicDisable
WorldLanguages opened this issue · 11 comments
Info for schema:
- Property name:
dynamicDisable
- Type: boolean
- Optional
- Defaults to
false
Description:
If set to true, addon userstyles should be removed from pages after the addon gets disabled, and the addon should be considered effectively disabled by Scratch Addons, even if it's still running userscripts on the page.
Note that as of now, userstyles are not removed if this property is set to true (defeating one of its main purposes). Addons with the "theme" tag do get their userstyles removed when disabled, however. Moving side effects of the "theme" tag to specific manifest properties is tracked in issue ScratchAddons/ScratchAddons#1672. At some point, all themes that currently get their styles removed when disabled will set this property to true instead of using a tag side effect.
Currently, this property is only used by themes that also run userscripts, so that they can be considered disabled even tho its userscripts are still running.
Yes this is very complex but I promise it will get better with time. Transitioning everything at once is not a good idea. Migration is painful but the result is no weird side effects.
I still confused about what should I put on the description. Could you help me out? @WorldLanguages
PS. Also, userscript instead of addon?
I still confused about what should I put on the description.
Me too, it's not something easy to describe lol.
PS. Also, userscript instead of addon?
That wouldn't be very accurate - addons that only have userstyles (which are all themes, but not the other way - some themes have userscripts) already follow this pattern (disabling the addon removes the styles, hence it's not "running" anymore, and it's not technically running either)
We're still discussing, this is a draft property
Updated the issue title and description to reflect the most recent draft
@Hans5958 If you don't mind, I will create a branch for this.
Should be resolved by #26
@TheColaber I have made local changes on my enviroment, no need for another PR.
@WorldLanguages Just wanted to make sure, are script addons going to be able to be disable and re-enabled dynamically?
@Hans5958 They already can be, all addons now get disabled and reenabled events in their userscripts, no matter if they set this on the manifest or not. What this manifest property will do in the future is also remove the addon's userstyles when it gets disabled.
@Hans5958 They already can be, all addons now get disabled and reenabled events in their userscripts, no matter if they set this on the manifest or not. What this manifest property will do in the future is also remove the addon's userstyles when it gets disabled.
Ah, only styles, it is.