So, Greasemonkey 4
doesn't support the usual GM_* API. Instead it offers a new asynchronous
GM.* API. This means that many userscripts using the old API, needs to be modified for compatibility with "both worlds". Probably no secret if your are a Greasemonkey user yourself, or if you've had a look at the "Scripts discussion" forum in the last couple of days.
The recommended way forward (and undoubtedly the most powerful and flexible) for script authors, is to adapt the asynchronous coding style and use something like gm4-polyfill
to ensure compatibility with the other userscript managers and their "legacy" GM_* API. This might however not be a fast or easy task done for everyone, so some might look for something simpler
I have created a library, GM Common API
(GMC), which makes a subset of the functionality from the other two APIs, available in one
API". It works with scripts running in both the new Greasemonkey 4 and running in the other userscript managers. It is also available on Greasy Fork
. I have used this library myself to make my own userscripts
compatible with Greasemonkey 4 (Except Flickr Fixr
, which currently doesn't need features of the APIs). If the features in GMC covers your needs, I think it is a much easier and faster way to GM4 compatibility.