Reputation: 5
Is there any way to make a changelog pop up when a TamperMonkey script updates?
I have already tried using LocalStorage to store current GM_info, but GM_info doesn't seem to exist/work.
Upvotes: 0
Views: 490
Reputation: 1942
I do this by hard coding a version number into my script, saving it to LocalStorage, and having the script check whether the stored version matches the version of the running script.
Rather than hard coding the version number separately, you should be able to use GM_info.script.version
to access the version number from the userscript metadata block - this ought to work in both GreaseMonkey and TamperMonkey.
However, note that from version 4.0, GreaseMonkey is moving to a new API: [GM.info][1]
rather than GM_info
. Currently, both work in GreaseMonkey v4.1, but only GM_info
works in TamperMonkey v4.4. If you've updated your script for GM4, you may have broken it for TamperMonkey.
Upvotes: 1