-
Notifications
You must be signed in to change notification settings - Fork 27
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
Migrate “GM_*” calls to Greasemonkey 4’s “GM.*” API #130
Comments
The code is currently constructed in a fairly synchronous way and may require a major rewrite to completely get rid of the synchronous calls. |
My 2 cents:
As is, I think we should be unconcerned of needing to change when two of the three main engines haven't stated plans to phase out the old API. Which maybe is not the wisest of statements. Even if Greasemonkey were to update after years of hiatus, and removed the old API completely, it'd probably be best to recommend using one of the other two. Not only because the script still works on them, but both are built for multiple browser engines. Greasemonkey's hold is Firefox only. I also don't think the other engines have incentive to remove the API since that would kill a lot of old scripts that don't get updates anymore. Also, on a personal annoyance note, in it's current state, Greasemonkey's built in editor is terrible to do any live troubleshooting with. It would freeze up the whole extension when I would go and select all to paste a new version of the script into. Requiring task killing firefox itself to get it to stop. It ended up being quicker to just uninstall the script and creating a new one every time. That personal note aside, let's worry about a rewrite when the others state plans to phase out. It should keep working regardless. Keep the issue open incase when that happens it manages to also break the fallbacks. But as is, I'm not inclined to believe it'll occur any time soon. |
See Greasespot: Greasemonkey 4 For Script Authors.
Greasemonkey 4 introduced new APIs for the functionality provided by
GM_
functions. As the blog post says, these APIs will eventually be faster than the old APIs. The new APIs also have clearer names and better organization.Currently, this script uses these
GM_
functions:webcomic_reader/webcomic_reader.user.js
Lines 54 to 59 in 26a1f6e
Steps to migrate:
GM_
function calls to use the asynchronousGM.
equivalents.@grant
comments@require
the polyfill, allowing the script to continue working with Violentmonkey, etc.I haven’t tested this script in Greasemonkey 4, but Greasemonkey 4 For Users implies that any functionality that relies on the
@grant
s above will not work in Greasemonkey 4 until those calls are migrated. SinceGM_xmlhttpRequest
is one of the grants, it is likely that the core functionality of this script is broken in Greasemonkey 4.The text was updated successfully, but these errors were encountered: