Skip to content

Single quote in script name breaks the user script #3035

Closed

Description

@LMLB

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');

Activity

  1. Cerberus-tm commented on May 11, 2019

    @Cerberus-tm
    Contributor

    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?

  2. StigNygaard commented on May 17, 2019

    @StigNygaard

    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?

  3. AltoRetrato commented on May 28, 2019

    @AltoRetrato

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

  4. StigNygaard commented on Jun 2, 2019

    @StigNygaard

    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 ...

  5. added this to the 4.9 milestone on Jun 12, 2019
  6. arantius commented on Jun 12, 2019

    @arantius
    Collaborator

    Manually merged the PR with an additional fix.

  7. StigNygaard commented on Jun 12, 2019

    @StigNygaard

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions