Greasy Fork is available in English.

مۇنازىرىلەر » Greasy Fork قا ئىنكاس

Changes to the downloadURL and updateURL

§
يوللانغان ۋاقتى: 2024-06-08
تەھرىرلەنگەن ۋاقتى: 2024-06-08

Currently, this is how they both look like

// @downloadURL https://update.greasyfork.org/scripts/333/Always%20HD.user.js
// @updateURL https://update.greasyfork.org/scripts/333/Always%20HD.meta.js

But after I updated the script name, from always HD to Always HD, tampermonkey/greasyfork no longer recognized the script as installed, so previous users of this script also can't update the script, even though when they install it on greasyfork it doesn't matter if downloadURL and updateURL exists or not, because greasyfork automatically add these two tags.

Can we have the script name removed from both?

That way it would be like

// @downloadURL https://update.greasyfork.org/scripts/333.user.js
// @updateURL https://update.greasyfork.org/scripts/333.meta.js

I believe that it would fix the issue I mentioned above where tampermonkey/greasyfork no longer recognizes the script as installed just because of a name change so that current users of the script wouldn't have to manually install the script again.

§
يوللانغان ۋاقتى: 2024-06-29
تەھرىرلەنگەن ۋاقتى: 2024-06-29

tampermonkey/greasyfork no longer recognized the script as installed,

No, it will.


Actually, the two URLs are read by the userscript manager. Then userscript manager can update the script at a certain interval.

The name can be arbitrary

https://update.greasyfork.org/scripts/333/abc.user.js

https://update.greasyfork.org/scripts/333/def.user.js

point to the same script.

What happen that the script name change

  1. script name change, new version, with changed downloadURL and updateURL (say https://update.greasyfork.org/scripts/333/def.user.js)
  2. userscript manager will read the old updateURL (https://update.greasyfork.org/scripts/333/abc.user.js)
  3. update is detected, the new script will be downloaded and replace the current old script.
  4. the overrided script will have the new downloadURL and updateURL

The problem is just that if you are not using the auto update, the button status in Greasy Fork will treat the new script as not yet installed.

Because the script checking in userscript manager's exposed API in Greasy Fork is name + namescript

§
يوللانغان ۋاقتى: 2024-06-29

@𝖢𝖸 𝖥𝗎𝗇𝗀

If you're right that's fine and not an issue then, at least not in tampermonkey, but it is still an issue on GreasyFork. I wish that GreasyFork could do the same as Tampermonkey then and don't think that simply because the name doesn't match it means that the script isn't installed.

§
يوللانغان ۋاقتى: 2024-06-29
تەھرىرلەنگەن ۋاقتى: 2024-06-29

changing to https://update.greasyfork.org/scripts/333.user.js would not help the case.

The button in Greasy Fork would be still "not installed".

Because the script checking in userscript manager's exposed API in Greasy Fork is name + namescript

§
يوللانغان ۋاقتى: 2024-06-29

@𝖢𝖸 𝖥𝗎𝗇𝗀

What is the diff between name + namescript? They sound like the same thing.
Since my suggestion is wrong, I suggest that greasyfork removes one of those "name + namescript".

§
يوللانغان ۋاقتى: 2024-06-29

The detection of the installation status from Greasy Fork is the feature provided by Tampermonkey and Violentmonkey.

function getTampermonkey() {
    var d;
    return (d = window.external) == null ? void 0 : d.Tampermonkey
}
function getViolentmonkey() {
    var d;
    return (d = window.external) == null ? void 0 : d.Violentmonkey
}
function getInstalledVersion(d, u) {
    return new Promise(function(c, m) {
        let h = getTampermonkey();
        if (h) {
            h.isInstalled(d, u, function(p) {
                p.installed ? c(p.version) : c(null)
            });
            return
        }
        let f = getViolentmonkey();
        if (f) {
            f.isInstalled(d, u).then(c);
            return
        }
        m()
    }
    )
}

You can open the DevTools to find the function.

window.external.Tampermonkey.isInstalled
window.external.Violentmonkey.isInstalled

The first parameter is the script name. The second parameter is the script namespace.

These are not related to @downloadURL and @updateURL

§
يوللانغان ۋاقتى: 2024-06-29

The first parameter that is the script name should be removed or ignored by greasyfork

جاۋاب قايتۇرۇش

جاۋاب قايتۇرۇش ئۈچۈن كىرىش.