#9 ✓resolved
Olivier Cornu

Failing unwrapped scripts are executed twice

Reported by Olivier Cornu | March 23rd, 2009 @ 02:39 PM | in 0.1a1

For backward compatibility purposes, following script wrapping mess in previous GM releases, we're left with the following code:


      if (!script.unwrap)
        scriptSrc = "(function(){"+ scriptSrc +"})()";
      if (!this.evalInSandbox(scriptSrc, url, sandbox, script) && script.unwrap)
        this.evalInSandbox("(function(){"+ scriptSrc +"})()",
                           url, sandbox, script); // wrap anyway on early return

In other words, if an unwrapped script fails to execute properly, it is wrapped and executed again. This might result in a page being (at least partly) modified twice.

Scripts failing because of @unwrap issues should be fixed, not "hot-patched" like this.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Webmonkey is a fork of the popular Greasemonkey extension for Firefox.

People watching this ticket

Referenced by

Pages