GitHub-Dark-Script
GitHub-Dark-Script copied to clipboard
Support for GM_*-style script injectors
Can you add a function that checks wether the GM.* functions are available and if not tries to use GM_* ?
I want to use this in https://github.com/AdguardTeam/AdguardForWindows but as of now it does only support the GM_* syntax.

Most of the GM_ functions are supported (ref).
The error is actually GM. which is what we added to support GM4. I'm not sure why the polyfill isn't working for you, but I guess we could detect the GM. functions and fallback to GM_ functions.
I hope they just implement the GM. variants, it's not that hard. In the meantime i try to manifest @ameshkov's answer into the docs (https://github.com/AdguardTeam/AdguardKnowledgeBase/pull/370).
And yes a check like if (GM === "undefined) would be neat, maybe there are other injectors that also just support the GM_ variants
GM4 has been out for a while and I see no movement from other engines towards GM., so I think it's pretty save to save those engines will probably stay on GM_.
GM4 has been out for a while and I see no movement from other engines towards
GM., so I think it's pretty save to save those engines will probably stay onGM_.
others, yes. ag no if i annoy andrey enough =D
Regarding this issue, I'm not sure what the exact problem is. We exclusively use GM. and the polyfill defines any GM_ ones if absent and then maps GM. to them, so in a engine only supporting GM_, those should be already be used. Could it be that the polyfill is not working for some reason?
Hmm, idk why in that case :thinking: