What are the differences between Fx 3.x and Fx 4.x that caused many users to stop working?

I am developing scripts for userscripts.org and just updated my fx from 3.6.16 to 4.0 but many of my scripts stopped working with the following error message:

Error: Component returned failure code: 0x8007000e (NS_ERROR_OUT_OF_MEMORY) [nsIXPCComponents_Utils.evalInSandbox]
Source code: file:///xxx.user.js


I know this message means some kind of "endless" process, but it doesn't contain line numbers that might help me figure it out.

Any help / answer / link is appreciated.

Operating system: Windows 7 64-bit
Greasemonkey version: 0.9.1
Example script that doesn't work:
Usercripts: Beautifier + Deobfuscator target: http://userscripts.org/scripts/review/58687
(I'll add some examples as soon as I get back home from work)

Other sources that made me think about the problem:
A lot of scripts no longer work?


source to share

2 answers

Since Firefox 4, you cannot use RegExp as a loop condition, because a new instance will be created for each iteration, causing an infinite loop. (lastIndex = 0)

while (/.../g.exec("...")) {  // used to work
    /* your code goes here */


To prevent this from happening, create a separate variable using RegExp:

var re = /.../g;
while (re.exec("...")) {  // works perfectly
    /* your code goes here */




The only feature I know of removing in Firefox 4 is the ability to use XUL directly in a web page (i.e. using -moz-binding

CSS styling ).

I don't know if this affected your scripts. This affected one fairly well-known Firefox hack (see text-overflow: ellipsis in Firefox 4? (And FF5) ), but I was not aware of any other impact of this change.



All Articles