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

Closed
LMLB opened this issue May 9, 2019 · 6 comments

Comments

Projects
None yet
5 participants
@LMLB
Copy link

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');
@Cerberus-tm

This comment has been minimized.

Copy link

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?

@StigNygaard

This comment has been minimized.

Copy link

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 Last.fm Album Linkr, until Greasemonkey has been updated, to avoid "disabling" them too?

badbrainz added a commit to badbrainz/greasemonkey that referenced this issue May 26, 2019

@AltoRetrato

This comment has been minimized.

Copy link

commented May 28, 2019

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

@StigNygaard

This comment has been minimized.

Copy link

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

Make the test actually fail (before the fix).
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
@arantius

This comment has been minimized.

Copy link
Collaborator

commented Jun 12, 2019

Manually merged the PR with an additional fix.

@arantius arantius closed this Jun 12, 2019

@StigNygaard

This comment has been minimized.

Copy link

commented Jun 12, 2019

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
You can’t perform that action at this time.