Greasy Fork is available in English.

討論 » 開發

Load a script from an external URL

§
發表於:2023-01-30

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?

§
發表於:2023-01-31

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

NotYou管理員
§
發表於:2023-01-31

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
NotYou管理員
§
發表於:2023-01-31

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

發表回覆

登入以回復