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

2

9

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.

Lioness answered 21/6, 2011 at 11:39 Comment(2)
Win 7/Chrome 12.0.742.100 - no problem for me opening that link.Brandi
And no error in your console either?Lioness
C
11

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.

Copro answered 21/6, 2011 at 11:51 Comment(4)
I have no clue how I cannot have thought of this. You were completely correct, it was the chrome extension "XML Viewer". Thanks.Lioness
Similar to H2ooooetc... Was getting the same error. The XML Viewer plugin was the cause.Wrestling
@Lioness can you post a link to the chrome extension? I'm getting [automated] error reports about this occasionally and need to reproduce it.Eldridgeeldritch
@Eldridgeeldritch i doubt the extension with the error is still available. This was asked 4.5 years ago, so extension and library have pretty certainly been updated since.Lioness
P
2

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.

Plasticity answered 30/5, 2012 at 16:32 Comment(1)
how do you upgrade xregexp for chrom to use 2.0+? I've got the latest version of chrome and it's at 1.5. I see this error all the time and I don't even have a single plugin installed!Lucubrate

© 2022 - 2024 — McMap. All rights reserved.