Skip to content
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

Not Compatible with GM 4.x #3

Open
GuardianMajor opened this issue Jul 7, 2018 · 0 comments
Open

Not Compatible with GM 4.x #3

GuardianMajor opened this issue Jul 7, 2018 · 0 comments

Comments

@GuardianMajor
Copy link

It works great on pre-webext (aka pre 4.0) version of GM on ESR but on versions where you can't use it and need to use the post 4.0 version (aka from 57+) then it doesn't work due to changes in the API.

Using TamperMonkey is not an option as it doesn't behave correctly and has too many quirks and even to make it run on that, you can add var in front of gmSet and gmGet to make it work, but that's not the issue really, just that TM is very finicky and with the developer shutting down the forum, its practically unsupportable.

The changes to the API for GM would mean that the two @grant entries for GM_setValue and GM_getValue need to be changed to the GM global object, aka GM.setValue and GM.getValue but that's unfortunately the only easy part of it. While the setValue is relatively without fuss, the getValue is much more involved that requires the use of async functions and await to properly return the value and avoid timing issues.

While not alot needs to be changed, it does need some reworking as with the spread of webext and the deprecation of browsers that can handle original GM, you need to bring this script inline with the newer methods to ensure compatibility. Maintaining backward compatibility if you want it, shouldm't be hard but again, needs some reworking. To avoid nagging in general, convert gmSet and gmGet to variables by adding the var it makes it more stable all around.

I have made tweaks to my own copy and have somewhat gotten it work right but still getting alot of glowing red llama errors/timeouts so hopefully you can do a less hacky version that works better. Let me know if I can help, but this would be a good start for you here: API Changes and GM.getValue and GM.setValue - hit me up if you need me to help or test anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant