Installation shouldn't fail when there is no parsable metadata #1562

Closed
kbntk opened this Issue Jun 4, 2012 · 16 comments

Comments

Projects
None yet
4 participants
@kbntk

kbntk commented Jun 4, 2012

I can't install greasemonkey user scripts from file on version 0.9.20.
The scripts could be installed in previous versions.

Do you have the same problem?

If more information is needed, I will put it here.

@arantius

This comment has been minimized.

Show comment
Hide comment
@kbntk

This comment has been minimized.

Show comment
Hide comment
@kbntk

kbntk Jun 4, 2012

This is what I got from the error console in my new fresh profile when I tried to load the greasemonkey script from File->Open File menu:

Timestamp: 06/04/2012 11:52:44 PM
Error: script is null
Source File: resource://greasemonkey/remoteScript.js
Line: 362

kbntk commented Jun 4, 2012

This is what I got from the error console in my new fresh profile when I tried to load the greasemonkey script from File->Open File menu:

Timestamp: 06/04/2012 11:52:44 PM
Error: script is null
Source File: resource://greasemonkey/remoteScript.js
Line: 362

@arantius

This comment has been minimized.

Show comment
Hide comment
@arantius

arantius Jun 5, 2012

Collaborator

What OS? Which file? What is its full path? All the rest of the details requested at http://wiki.greasespot.net/Greasemonkey_Manual:Getting_Help#What_to_Say ?

Collaborator

arantius commented Jun 5, 2012

What OS? Which file? What is its full path? All the rest of the details requested at http://wiki.greasespot.net/Greasemonkey_Manual:Getting_Help#What_to_Say ?

@kbntk

This comment has been minimized.

Show comment
Hide comment
@kbntk

kbntk Jun 5, 2012

OS: Kubuntu Linux 12.04
KDE 4.8.3
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0
Scripts:
All my published script can't be installed right now:
https://userscripts.org/users/405846/scripts
I could install these scripts before.

Hint: I discovered that I can install other scripts like e.g.
http://userscripts.org/scripts/show/70238

kbntk commented Jun 5, 2012

OS: Kubuntu Linux 12.04
KDE 4.8.3
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0
Scripts:
All my published script can't be installed right now:
https://userscripts.org/users/405846/scripts
I could install these scripts before.

Hint: I discovered that I can install other scripts like e.g.
http://userscripts.org/scripts/show/70238

@sergioabreu

This comment has been minimized.

Show comment
Hide comment
@sergioabreu

sergioabreu Jun 12, 2012

It's because the script is not UTF-8 and has special chars in it.
I had this issue. Once the file is charset UTF-8 you will be able to install again.

It's because the script is not UTF-8 and has special chars in it.
I had this issue. Once the file is charset UTF-8 you will be able to install again.

@arantius

This comment has been minimized.

Show comment
Hide comment
@arantius

arantius Jun 12, 2012

Collaborator

I can't install https://userscripts.org/scripts/version/113690/378080.user.js either from a file or that URL, I get the 'script is null' error mentioned. Haven't diagnosed why yet.

Collaborator

arantius commented Jun 12, 2012

I can't install https://userscripts.org/scripts/version/113690/378080.user.js either from a file or that URL, I get the 'script is null' error mentioned. Haven't diagnosed why yet.

@sergioabreu

This comment has been minimized.

Show comment
Hide comment
@sergioabreu

sergioabreu Jun 12, 2012

My comment is related to first question. It seems last GM versions was "more tolerant" when the charset of the script file or text was not UTF-8. Now the script file MUST be UTF-8, I faced this because my scripts have latin chars sometimes... For me it worked, just convert the charset of the file.

My comment is related to first question. It seems last GM versions was "more tolerant" when the charset of the script file or text was not UTF-8. Now the script file MUST be UTF-8, I faced this because my scripts have latin chars sometimes... For me it worked, just convert the charset of the file.

@arantius

This comment has been minimized.

Show comment
Hide comment
@arantius

arantius Jun 12, 2012

Collaborator

Yes, a bit of the character set handling WRT downloading scripts changed recently. I thought it already forced UTF-8 somewhere, that might not have been true. If you can give me confirmation of a particular script that won't install in 0.9.20 but does in an earlier version that will make improving things easier.

Collaborator

arantius commented Jun 12, 2012

Yes, a bit of the character set handling WRT downloading scripts changed recently. I thought it already forced UTF-8 somewhere, that might not have been true. If you can give me confirmation of a particular script that won't install in 0.9.20 but does in an earlier version that will make improving things easier.

@Ventero

This comment has been minimized.

Show comment
Hide comment
@Ventero

Ventero Jun 12, 2012

Contributor

Actually the reason the scripts on https://userscripts.org/users/405846/scripts all throw this error is because parse returns null because extractMeta can't find the metadata, which is simply because there's no lines starting with // ==UserScript== and // ==/UserScript== in the script, only // // ==UserScript==.

Contributor

Ventero commented Jun 12, 2012

Actually the reason the scripts on https://userscripts.org/users/405846/scripts all throw this error is because parse returns null because extractMeta can't find the metadata, which is simply because there's no lines starting with // ==UserScript== and // ==/UserScript== in the script, only // // ==UserScript==.

@arantius

This comment has been minimized.

Show comment
Hide comment
@arantius

arantius Jun 12, 2012

Collaborator

Good catch, that should probably be return script, not return null.

Collaborator

arantius commented Jun 12, 2012

Good catch, that should probably be return script, not return null.

@kbntk

This comment has been minimized.

Show comment
Hide comment
@kbntk

kbntk Jun 12, 2012

@sergioabreu:
My files are UTF-8 encoded: these on my hard disk as well as those uploaded to userscripts.org.
I checked it with vim, :set fileencoding
and I got fileencoding=utf-8

kbntk commented Jun 12, 2012

@sergioabreu:
My files are UTF-8 encoded: these on my hard disk as well as those uploaded to userscripts.org.
I checked it with vim, :set fileencoding
and I got fileencoding=utf-8

@sergioabreu

This comment has been minimized.

Show comment
Hide comment
@sergioabreu

sergioabreu Jun 12, 2012

Kbntk other point you should check is if you use any setTimeout in your scripts.
Last versions supported strings as the first argument.
Now GM only works with functions, I mean: setTimeout("afunction()", time) must be converted to setTimeout(function(){ /code/} , time) for it to work. Some old scripts of mine has this issue as well.

Kbntk other point you should check is if you use any setTimeout in your scripts.
Last versions supported strings as the first argument.
Now GM only works with functions, I mean: setTimeout("afunction()", time) must be converted to setTimeout(function(){ /code/} , time) for it to work. Some old scripts of mine has this issue as well.

@arantius

This comment has been minimized.

Show comment
Hide comment
@arantius

arantius Jun 12, 2012

Collaborator

Kbntk other point you should check is if you use any setTimeout in your scripts.
Last versions supported strings as the first argument.

That was broken in 0.9.19, but that breaking change was reverted, in .20 everything works as it always used to.

Collaborator

arantius commented Jun 12, 2012

Kbntk other point you should check is if you use any setTimeout in your scripts.
Last versions supported strings as the first argument.

That was broken in 0.9.19, but that breaking change was reverted, in .20 everything works as it always used to.

@kbntk

This comment has been minimized.

Show comment
Hide comment
@kbntk

kbntk Jun 12, 2012

The issue Ventero pointed was the reason the scripts didn't work.
Thank you guys for your help!

kbntk commented Jun 12, 2012

The issue Ventero pointed was the reason the scripts didn't work.
Thank you guys for your help!

@arantius

This comment has been minimized.

Show comment
Hide comment
@arantius

arantius Jun 12, 2012

Collaborator

Changed the title to reflect the issue as it has now been described.

Collaborator

arantius commented Jun 12, 2012

Changed the title to reflect the issue as it has now been described.

@sergioabreu

This comment has been minimized.

Show comment
Hide comment
@sergioabreu

sergioabreu Jun 12, 2012

shouldn't fail or would fail ? Did you meand "shouldn't HAPPEN" ?

shouldn't fail or would fail ? Did you meand "shouldn't HAPPEN" ?

@arantius arantius closed this in d6d1c07 Jun 15, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment