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
Refactor GM_API #2299
Comments
The benefit is quite small, and the cost (every script breaks) is high. Not likely. If you want to use web APIs, just |
The old scripts will continue working if the old API won't be eliminated, but deprecated with warnings in devtools/firebug console.
I need WebAPI have some properties of GM API : context of the script (if I save the data to WebStorage now, it will save the data to the page's webstorage, not the script's one), non-requesting permissions for the sites (but it can request permission for the script (in the request it should be explicitly marked that the permission is requested by the userscript) and the user should be able to revoke every permission individually in any moment of time). |
Maybe you're thinking too much in chrome-isms where addons run in full-blown web page contexts (background page) where an isolated set of web APIs are available. This is not the case with GM scripts, things either come from the page itself or from hand-woven code. There is no re-use opportunity to import something from a separate context. Well, technically one could do something like that with hidden pages, but it would be a lot of work. You might look into the future webextensions stuff instead: https://wiki.mozilla.org/WebExtensions |
No, i just think that
IMHO webextensions are too heavy to replace userscripts (they require extension to be packed to zip and separated into pieces, where script having access to dom is unpriveleged), userscripts' task is to modify the page, extensions is to modify the browser. |
Well, my point is that a) you can use the APIs already available within the page context itself Am I missing some middle ground here? |
Ad WebNotification: See also https://bugzilla.mozilla.org/show_bug.cgi?id=862395 |
Hello. I think the GM_API is obsolete and needs refactoring.
GM.metadata
GM.resources[resourceName]
, and the type of resource should be taken in accountimport
should be available asGM.modules[moduleName]
The text was updated successfully, but these errors were encountered: