Extra caution is recommended when installing recently uploaded/updated scripts (read more)
Be sure you trust any scripts you install
Script Update Checker
Code to add to any Greasemonkey script to let it check for updates.
Description
This is a tool for Greasemonkey script writers. If you don't write scripts, don't bother installing it.This paste-in code snippet will check for new versions of an installed script and prompt the user to update.
Notes (also in the source code):
- Feel free to copy this into any script you write; that's what it's here for. A credit and/or URL back to here would be appreciated, though.
- I was careful to use as few variables as I could so it would be easy to paste right into an existing script. All the ones you need to set are at the very top.
- The target script needs to be uploaded to a permanent place, preferably userscripts.org. The update checks will not increase the install count for the script there.
- Remember to change the version_timestamp every time the script is updated. Really.
- This script is set up to check for updates to itself by default. It may be a good idea to leave it like this; I update my scripts much too often.
- It will only work for scripts hosted on userscripts.org without a bit of tweaking.
Scripts Using Update Checker
Leave a comment if you'd like to be listed here.- Everything I've written
- lazygirls.info by nick_name
- Facebook Fixer by Vaughan Chandler
- BattleKnight Autologin by Astaroth
Updates
- [02/16/08]: A recent change to userscripts.org made update checks count as installs, so the script now checks for updates through the "View Script Source" page instead of the actual .user.js file. Script now brings the user to the script's information page instead of straight to the source file. You no longer need to paste in the entire URL to the script, only the script's ID number. Added menu option to check for updates manually (thanks, ngattuso!).
- [01/16/08]: Changed the window.open() to GM_openInTab() to avoid popup blockers. Thanks, BlindWanderer!
- [01/15/08]: Added a compacted version of the script (it's down there at the bottom, commented out).
|
|
Hi Jarett ! I'm using Opera which does not have support for Maybe you would like to add a Example: MusicBrainz Subscriptions |
|
|
I'm start using your script with a less modification in my "BattleKnight Autologin" Script ( http://userscripts.org/scripts/show/23744 ). |
|
|
Hi, thanks a lot for this script. I started using it in my script Facebook Fixer today ( http://userscripts.org/scripts/show/8861 ) and I included a links to your profile and to this script. I would greatly appreciate a link back in your "scripts using update checker" section. Thanks :) |
|
|
Thanks! I think both of those are useful additions. I was also going to change it to take the user to the script page instead of the actual script if it's hosted on userscrips.org; that way they can see what changes have been made to the script before they upgrade. I'll include your changes in the update. |
|
|
Nice script. I extended it a little to add error handling and messages for forced updates through the menu. I kept it generic so you could include it here for everyone. The src is at the bottom of my Facebook GM script. Good work |
|
|
That's the entire Greasemonkey philosophy. Or, at least, it's my philosophy that I apply to Greasemonkey scripts. :P |
|
|
Very good idea.
|
|
|
Oh, I didn't even know about that function. I have actually been looking for a way around the popup blocker, so I'll change it in the source. Thanks! |
|
|
I had problems with window.open (popup blocker) so I'm using GM_openInTab instead. |
You could comment on this script if you were logged in.
