Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4343932
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:49:26+00:00 2026-05-21T11:49:26+00:00

Just to be clear: I am not looking to do an auto update. I

  • 0

Just to be clear: I am not looking to do an auto update. I would just simply like to let the user know that there is an updated script and give them a link where they can go and get the latest version.

There a few ways of doing this in Firefox but they all seem to use Greasemonkey specific features that are not supported in Chrome.

I have spent a good 4 hours today researching this and now I am looking at the SO community for help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T11:49:27+00:00Added an answer on May 21, 2026 at 11:49 am

    Thank you to Yi Jiang who posted this link in a comment. Just in case that script goes away I will post the contents here:

    // ==UserScript==
    // @name           SelfUpdatingScript
    // @version        1.0.0
    // @namespace      Benjol (http://stackoverflow.com/users/11410/benjol)
    // @description    Template script for a self-updating script
    // @credits        Kudos to http://stackoverflow.com/users/115866/balpha
    // @include        https://gist.github.com/*
    // ==/UserScript==
    
    function with_jquery(f) {
      var script = document.createElement("script");
      script.type = "text/javascript";
      script.textContent = "(" + f.toString() + ")(jQuery)";
      document.body.appendChild(script);
    };
    
    with_jquery(function ($) {
      $(function () {
        //how does this work?
        // 1. The installed script loads first, and sets the local VERSION variable with the currently installed version number
        // 2. window["selfUpdaterCallback:" + URL] is not defined, so this is skipped
        // 3. When updateCheck() is called, it defines window["selfUpdaterCallback:" + URL], which retains the installed version number in VERSION (closure)
        // 4. updateCheck() then loads the external version of the script into the page header
        // 5. when the external version of the script loads, it defines its own local VERSION with the external (potentially new) version number
        // 6. window["selfUpdaterCallback:" + URL] is now defined, so it is invoked, and the external version number is passed in
        // 7. if the external version number (ver) is greater than the installed version (VERSION), the notification is invoked
        var VERSION = 1.0;                                                         // than 1.13; if you mean 1.02, say so!)
        var URL = "https://gist.github.com/raw/874058/selfupdatingscript.user.js"; // VERSION)
              notifier(ver, VERSION, URL);
          }
    
          // make that a script tag. SO will not allow me to have a greater sign infront.
          /*$(' script />').attr("src", URL).appendTo("head");*/
        }
    
        // INSERT YOUR CUSTOM SCRIPT AFTER THIS COMMENT
        //Customize this code in the following ways
        //  - modify the callback to show your own custom notification
        //  - You could decide to check for updates less frequently that on every page load
        updateCheck(function (newver, oldver, url) {
          alert("A new version (" + newver + ", your current version is " + oldver + ") of the SelfUpdatingScript is available for download here: " + url);
        });
      });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The javascript one seems pretty simple, just localStorage.clear(). Is there anything similar to that
I'm just starting with django. It is not quite clear to me, how should
I just wanted to know what's the difference between clear() and str(); For example:
First of all, I'm using Windows, just to make that clear. I am using
I am looking for a clear explanation to my question (NOT looking for code),
The question may be not very clear as I'm not looking for a solution
To be clear, I am not looking for NaN or infinity, or asking what
I'm looking for a simple clock synchronization protocol that would be easy to implement
I'd just like to ask if there are other alternatives for REALStudio or Runtime
Just a foreword: I'm not exactly clear on how a RNG actually works. If

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.