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
[suggestion] clean function: A function to clean what the script has done when disabling it #2387
Comments
You can refresh the page. |
Any use case that the user will dis/enable a script often? |
No kidding ! |
I didn't say often, i personally use it when looking for a script that does a specific functionality, i always find multiple scripts that does the same functionality so i download them both and go to the webpage and then disable and enable each of the scripts to see which script does the job better |
👎 Due to how many changes a script could make, there is no way for GM to do anything to "clean" what was done to a page. Creating a For your use-case, I would personally say the best way to analyze multiple scripts is to analyze them separately: enable one, test it, disable, with refreshes in between. |
It was meant seriously (it's used commonly)... |
Agreed, this would be useful only if every script used it, but few would bother. |
Don't know if this was suggested or implemented already but I'm going to write it anyway.
My idea is an API function that get invoked when the user disable a specific script inside a web page.
For example, i create a user script that adds some functions to facebook and also changes some of the tree nodes and styling obviously, so when a user is in a facebook page and want to disable the script from greasmonkey toolbar icon a function in the script (GM_clean maybe ?) get invoked, this function can be used to clean what the script has done to the web page (removing nodes and styles, cleaning some memory maybe).
Also a second function (GM_Enabled maybe) to be run when the script is enabled again
The text was updated successfully, but these errors were encountered: