Discussions » Development

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

§
Posted: 2014-09-24

@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?

§
Posted: 2014-09-25

Can you provide a real example?

§
Posted: 2014-09-25

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.

§
Posted: 2014-09-25
Edited: 2014-09-25
// ==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.

§
Posted: 2014-09-25

What about with it?

§
Posted: 2014-09-26

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

§
Posted: 2014-09-26

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?

§
Posted: 2014-10-06

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.

Post reply

Sign in to post a reply.