11

At the top of my script I have the following:

// ==UserScript==
// @name         Test script
// @description  testing auto-update
// @namespace    http://tampermonkey.net/
// @author       newbie
// @version      1.0.0
// @updateURL    https://github.com/mygithubaccount/test/raw/master/test.user.js
// @downloadURL  https://github.com/mygithubaccount/test/raw/master/test.user.js
// @match        http://awebsite.com/*
// @run-at       document-end
// @grant        GM_getResourceText
// @grant        GM_addStyle
// @grant        GM_xmlhttpRequest
// @grant        GM_getResourceURL
// @grant        GM_xmlhttpRequest
// ==/UserScript==

Please note that these values are just for example.

When I make changes on the script and increase the version number on github and then push the changes to master it updates the raw script link, however I don't get auto-updates from Tampermonkey as in popups saying the script has an update. It will only update if I manually go to the link and reinstall the script to update it.

How can I make this auto-update with popups?

newbie
  • 1,551
  • 1
  • 11
  • 21
  • Check if the new version is really accessible through the URL. It is best to use the same single URL for: install, update and download. Then do not specify `@updateURL` or `@downloadURL` at all. See [Why is usage of the downloadURL & updateURL keys called unusual and how do they work?](https://stackoverflow.com/a/38025376/320437) – pabouk - Ukraine stay strong May 17 '22 at 13:42

1 Answers1

12

I am not an expert at userscripts, can only tell from my experience making TamperMonkey work:

In order for TamperMonkey to update, I had to copy&paste the URL into Update URL: on the script's Settings tab: here is a screenshot

(Make sure ☒ Check for updates is turned on, obviously.)

Then if you manually Check for userscript updates on the TamperMonkey icon, you should see a proper popup.

Gerold Broser
  • 14,080
  • 5
  • 48
  • 107
Shal
  • 121
  • 1
  • 3
  • 1
    This hint is gold! I changed `// @updateURL ...` in my script after installing since there was a typo, but _Settings_ → _**Updates**_ → _Update URL:_ [...] wasn't changed accordingly. – Gerold Broser Dec 19 '19 at 11:25
  • 2
    Additional note to that: Once you do any change on the Editor tab and save it, the Checkbox `Check for updates` gets turned off. – DBX12 Apr 14 '22 at 06:41
  • 1
    When you install the script from a correct URL (on which the new versions will be released) and new versions update `@version` you do not need to specify `@updateURL`. It is even better to not specify it. See [Why is usage of the downloadURL & updateURL keys called unusual and how do they work?](https://stackoverflow.com/a/38025376/320437) – pabouk - Ukraine stay strong May 17 '22 at 13:36