Greasy Fork is available in English.

Discussioni » Sviluppo

@required directive breaks down userscript when version is specified as parameter

§
Pubblicato: 24/09/2014

@required directive breaks down userscript when version is specified as parameter

Library scripts included with the provided from Greasy Fork // @require https://greasyfork.org/scripts/example/code/example.js?version= directive seems to break down user script because of the version specified as a parameter. When the url points to the js only, everything seems to be fine. Am I the only one with this problem?

§
Pubblicato: 25/09/2014

Can you provide a real example?

§
Pubblicato: 25/09/2014

In my case I tried adding this (// @require https://greasyfork.org/scripts/5279-greasemonkey-supervalues/code/GreaseMonkey_SuperValues.js?version=18765) library, that I uploaded myself, but did not wrote. The script showed no error, nor greasemonkey complained, it was like you made a syntax error or something. Removing the ?version=18765 parameter miraculously fixed this issue and imported the library successfully. You're welcome to try and reproduce that case and I'll be happy to see the results.

§
Pubblicato: 25/09/2014
Modificato: 25/09/2014
// ==UserScript==
// @name        Require parameter test
// @namespace   lkjfd
// @version     1
// @require https://greasyfork.org/scripts/5279-greasemonkey-supervalues/code/GreaseMonkey_SuperValues.js?version=18765
// @grant       none
// ==/UserScript==

console.log(GM_SuperValue);

Result:

"This library requires Greasemonkey! GM_getValue is missing." GreaseMonkey_SuperValues.js:34
Object { set: GM_SuperValue/this.set(), get: GM_SuperValue/this.get() } Require_parameter_test.user.js:10

I get the same result without the version parameter.

§
Pubblicato: 25/09/2014

What about with it?

§
Pubblicato: 26/09/2014

I get the same result regardless of whether I include the version parameter.

§
Pubblicato: 26/09/2014

I wonder if you somehow got a bad version of the file and Greasemonkey's caching it. Can you look in your profile under gm_scripts and see what version of the library is in there?

§
Pubblicato: 06/10/2014

It must have been completely my fault. The problem disappeared as miraculously as it has appeared. I cannot even seem to reproduce it anymore. If any stumbles upon similar situations, try deleting the downloaded version in the profile and let greasemonkey re-download it again. I am sorry for your wasted time.

Pubblica risposta

Accedi per pubblicare una risposta.