Greasy Fork is available in English.

Discussions » Développement

Load a script from an external URL

§
Posté le: 30/01/2023

Am I allowed to load a script (library) from an external URL?

I am currently developing a scripting api, which I update regulary and push updates here and then. A lot of greasyfork scripts use this library, and its a pain when I have to update each script with the new library version. Is there anything that I can do?

§
Posté le: 31/01/2023

yes you are, specially because many other scripts already use that library according to you

Which library are you talking about? pls link it here

NotYouMod
§
Posté le: 31/01/2023

Yes, you are allowed, but only if you follow going to follow this guide (Greasy Fork's libraries/external libraries' usage policy).

If you want to get the newest version of library from greasy fork, you can just not specify version search parameter, so URL will look like this:

https://greasyfork.org/scripts/456235-moomoo-js/code/MooMoojs.js

This is not recommended, but if you always want latest version, you can do it.

Example user-script:

// ==UserScript==
// @name User Script
// @namespace -
// @version 1.0.0
// @description description
// @author You
// @match *://*/*
// @run-at document-body
// @license GPL-3.0-or-later
// @grant none
// @require https://greasyfork.org/scripts/456235-moomoo-js/code/MooMoojs.js
NotYouMod
§
Posté le: 31/01/2023

I totally forgot about // ==/UserScript== at the end of user-script's meta values. Do not forget to put it at the end! :P

Poster une réponse

Connectez-vous pour poster une réponse.