What is GM Script Update Control for?

  • Userscript developpers can include the script in their own to help their users to keep up-to-date.
  • Userscript users can include the script in any of their userscript coming from userscript.org to keep up-to-date. It's very easy to do with any text-editor...

How to use it?

Good old method : Copy and Paste

  1. Copy part of the source script between
    /* COPY ALL THIS -> END  */
    and
    /* END OF COPY ZONE */
  2. Paste it in your own script just after
    // ==/UserScript==
  3. Update the two vars for Id (Id is the ref number of the script in userscripts : http://userscripts.org/scripts/show/yourScriptId) and current version of your script (duplicate of @version yourScriptVersion metadata). Please, remember not to put any space in your version number use _ (underscore) instead.
    var myScriptId=yourScriptId
    var myScriptVersion="yourScriptVersion";
    You can also set control frequency in order to consume less bandwidth set this with this parameter :
    var GMSUCfreq=9;			// frequence of control updates (days)
  4. You might like to customize (very little)
    • Delay before alert disapears (set to 0 if you don't want it to disapear) :
      var GMSUCtime=16;		// delay before alert disapears. 
    • Choose your color palette :
      var GMSUCPal=cpUserscript; 	// colorPalette you prefer
      three are proposed : cpChrome, cpUserscript or cpFlickr, but you may ad any you want to create by defining a new one using var yourPalette=new colorPalette(background,highlight,foreground,light);
  5. That's all, enjoy...

Brand new method may be not working : @require

I did test this method on this testing script and it seems to work.

There are some limitation of @require usage in GreaseMonkey : The GM Script Update Control used by your script will be the one available at the date of the FIRST install by your users. If you update your script, GM_scriptVersionControl function WILL NOT upgrade to last version. Users will have to uninstall and reinstall your script to have it updated. It may cause some compatibility problems...

  1. ad the @require parameter in the header of your script
    // @require http://userscripts.org/scripts/source/35611.user.js
  2. redefine the mandatory parameters
    thisId=yourScriptId;
    thisVersion="yourScriptVersion";
  3. customize if you want with any of the other parameters. See above for more details
    GMSUCfreq=9;    // control frequency
    GMSUCtime=16; // disapearing delay
    GMSUCPal=cpUserscript; // color palette
  4. Launch the script in yours
    GM_scriptVersionControl();

Do i need to install it?

Definitely not. You may only copy-paste the function from the source script.
But you may find useful to be informed of future updates. If installed, the GmScript will prompt you about this...

Contribute

Translations

the alert message is displayed in French or in English (default) using the navigator.language property. If you put any translation in comment here or there, i will be pleased to implement it. Use the following models please :

// français
Txt[1]["fr"]="Vous utilisez la version";
Txt[2]["fr"]="du script";
Txt[3]["fr"]="La version officielle est différente";
Txt[4]["fr"]="installer";
Txt[5]["fr"]="voir le code";
Txt[6]["fr"]="propulsé par";
// english
Txt[1]["en"]="You're using";
Txt[2]["en"]="version of";
Txt[3]["en"]="script. Official release version is different";
Txt[4]["en"]="install";
Txt[5]["en"]="view code";
Txt[6]["en"]="powered by";

Color palette

If you think you're a color genius and defined a pretty nicest of the world colorPalette, post it here or there...

Anything else

As you can see through Revisions history, i'm very pleased about any comment you can do about this script and its functionalities. And I manage to take care of your idea when i got time for this. Please, don't wait and put anything you brain has in about this script here or there...

Licence

as I had no idea about licensing this work, i putted it under the creative-commons by-nc-sa one.

creative commons by-nc-sa logo

Revisions history

  • version 0.5 (2009 06 01)
    • testing enabling @require usage in order to please IzzySoft. Please note :
      • it may not work. I can't test it since none of the script containing @require can be installed on my computer and I don't know why,
      • your GM Script Update Control version will not be updated for your users each time your script is. Users will have to de-install and re-install to have last GM Script Update Control version.
    • added colorPalette management developped for Google Smart Subscriber and made some minor cosmetics "improvements".
  • version 0.4 (2009 04 17)
    • you may now set control frequency for your script in order to avoid too much bandwidth consumption. However, all users connected on release date will be proposed for an update... Special thanks to NOrack who gave me this idea.
  • version 0.3 (2009 04 12)
  • version 0.2 (2009 04 06)
    • fixed bug in Firefox 3.1b/3.5b : new way to handle characters by the DOM causing bad interpretation of version id. Script now cleaning version number for any space, null, return or any "strange" character.
    • fix userscript homepage bug when not logged in (google ad javascript comment marked with <!-- * */--> instead of /* */
    • version only verified in main window
  • version 0.1 (2008 11 26)
    • version 0.1.b (2009 01 21) : updated script to include new userscript.org script page layout (it's very versatile isn't it?)
    • modified display : three button to go to homepage, source code or install and a link to this page
    • minor bugs removed
  • version 0.0.4 (2008 11 14)
    • moved styling, alert text to avoid loading when not needed
    • added auto-hide of alert message to make script less obstrusive. You might disable it by editing parameters (see above)
    • some customization now (colors) ;-)
  • version 0.0.3 (2008 10 21)
    • gave up remote calling (for the moment)
    • inverted id and version vars (it's way more logical now ;-)
    • rewrited code to embed all parameters (lang, style...) in function
  • version 0.0.2
    • added en/fr language support
    • testing script without @include meta
  • version 0.0.1
    • a : bugs correction
    • added scriptId
  • version 0.0.0 : initial release