Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single quote in script name breaks the user script #3035

LMLB opened this issue May 9, 2019 · 6 comments

Single quote in script name breaks the user script #3035

LMLB opened this issue May 9, 2019 · 6 comments


Copy link

LMLB commented May 9, 2019

console.error('Script error in ${this.toString()}:'

this.toString() is inserted without escaping the \ and ' characters.

Example that reproduces the issue:

// ==UserScript==
// @name Single quote ' test
// @include *
// ==/UserScript==
console.log('Single quote test');
Copy link

Cerberus-tm commented May 11, 2019

I have experienced this bug too. And it must be new, because all of a sudden one of my userscripts gave a mysterious error in the browser console, and it just failed to execute altogether. It had been functioning perfectly since forever.

@LMLB So it was very hard for me to locate this error. How did you do it?

Copy link

StigNygaard commented May 17, 2019

Confirmed. But there's more to the problem.

I have several userscripts named something like "Stig's scriptname". Some of them was working, but one wasn't working for me. The one that wasn't working didn't seem to be activate at all. I couldn't get it to write anything in the console.

After some experiments including turning scripts on and off (and seeing this issue), I have come to the conclusion:

  1. If script is already installed, enabled and working, it will continue to work if you don't mess around with it (Until it is updated).
  2. If you disable a script, you cannot get it working again by re-enabling it :-( It seems to be permanently disabled (or in a non-working state) even though status says it is enabled.

Me too think it must be a recent problem, probably caused by latest Greasemonkey update.

A couple of days ago I released an update to Stig's Flickr Fixr, thus probably "disabling" the script for all current Greasemonkey users. Now I better hold back updating my two other userscripts, Stig's Art Grabr and Stig's Album Linkr, until Greasemonkey has been updated, to avoid "disabling" them too?

Copy link

I've met this issue as well. Hoping that a new release will fix this soon!

Copy link

StigNygaard commented Jun 2, 2019

Hi @arantius
Assuming @badbrainz 's commit fixes this problem, what is the ETA of a new Greasemonkey release? Will we wait for other stuff before releasing a new version? Yes, I'm a bit impatient ...

@arantius arantius added this to the 4.9 milestone Jun 12, 2019
arantius added a commit to arantius/greasemonkey that referenced this issue Jun 12, 2019
The `EditableUserScript` constructor does not parse the content, so this was generating a relevant line:

    console.error('Script error in gm_script_id null/user-script:'

which did not reproduce the bug being fixed.

Refs greasemonkey#3038
Refs greasemonkey#3035
Copy link

Manually merged the PR with an additional fix.

Copy link

And all seems normal again in 4.9. Thanks :-)

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

No branches or pull requests

5 participants