Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome: Uncaught Error: can't load XRegExp twice in the same frame

The following code will fail in both of my chromes on 2 different computers (Windows 7 both of them, Chrome 12.0.742.100).

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <title>Test</title>
        <script type="text/javascript">
            location.hash = "#one";
            location.hash = "#two";
            location.hash = "#three";
        </script>
    </head>
    <body>
        This will error out "Uncaught Error: can't load XRegExp twice in the same frame" in chrome. Anyone got an answer?
    </body>
</html>

I feel like I tried everything. Can anyone confirm this error on chrome, and does anyone have an idea as to how I fix it? Thanks a lot.

URL to error: http://jalsoedesign.net/test/hashchanging/

I should add: It works fine, does what it should (changes the page hashes), but still comes out with an error.

like image 457
h2ooooooo Avatar asked Jun 21 '11 11:06

h2ooooooo


2 Answers

It works fine with me on Chrome 12.0.742.100 on Win7. I'm assuming you have installed extensions? disable all extensions (or go to incognito mode) and try to load your page again. Errors from content scripts are also displayed in the javascript console. If you are not using XRegExp on your page, probably one of the extensions does.

Edit:

The source of the exception should be located to the right. Click it to go to the script that caused the exception.

like image 71
Jan Avatar answered Oct 24 '22 14:10

Jan


Extensions that use XRegExp should upgrade to v2.0.0 or later. That will avoid this error even when XRegExp is (inappropriately) loaded more than once in the same frame.

like image 23
slevithan Avatar answered Oct 24 '22 13:10

slevithan