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.

slevithan
  • 1,344
  • 12
  • 20
h2ooooooo
  • 36,580
  • 8
  • 61
  • 97

2 Answers2

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.

Jan
  • 7,801
  • 3
  • 35
  • 57
  • 7
    I have no clue how I cannot have thought of this. You were completely correct, it was the chrome extension "XML Viewer". Thanks. – h2ooooooo Jun 21 '11 at 11:54
  • 1
    Similar to H2ooooetc... Was getting the same error. The XML Viewer plugin was the cause. – PeterToTheThird Jan 25 '13 at 01:03
  • @h2ooooooo can you post a link to the chrome extension? I'm getting [automated] error reports about this occasionally and need to reproduce it. – Jayen Jan 13 '16 at 07:33
  • @Jayen 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. – h2ooooooo Jan 13 '16 at 07:36
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.

slevithan
  • 1,344
  • 12
  • 20
  • 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! – Jacksonkr Sep 30 '13 at 14:13