Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome Unverified URL issue on iOS #23

Closed
pedrosanta opened this issue Aug 15, 2014 · 10 comments
Closed

Chrome Unverified URL issue on iOS #23

pedrosanta opened this issue Aug 15, 2014 · 10 comments
Labels

Comments

@pedrosanta
Copy link

Hi, just like this issue on XDomain (jpillora/xdomain#76) I'm just using xhook and I'm also having the "Unverified URL" issue on Chrome on iOS.

If I remove xhook altogether, the issue disappears. But I need xhook, since it is the only way I could make my web app work on Windows Mobile 7 browser.

Cheers.

@jpillora
Copy link
Owner

Hey @pedrosanta I'm still looking for a work around. Looks like this might actually be a bug in Chrome iOS. The following page reproduces it for me:

<html>
<body>
<h1>Chrome iOS Bug</h1>
<script type="text/javascript">
    function overwrite() {
        window.XMLHttpRequest = function() {
            console.log(42)
        }
        print("overwrote xhr!")
    }

    //DOES WORK
    // setTimeout(overwrite, 0)

    //DOES *NOT* WORK
    overwrite()

    //cant see console.logs on the iphone
    function print(str) {
        var e = document.createElement("h2")
        e.innerHTML = str
        document.body.appendChild(e)
    }
</script>
</body>
</html>

Edit: This page is being hosted here http://snippets.jpillora.com/view/public/html/chromeiosbug.html

@jpillora
Copy link
Owner

So it's a bit annoying though here's something that seems to work:

If your app loads with:

var app = new App();

Then you'll need to:

xhook.disable();
setTimeout(function() {
    xhook.enable();
    start();
});

function start() {
    var app = new App();
}

http://snippets.jpillora.com/view/public/html/xhookworkaround.html

@unnawut
Copy link

unnawut commented Aug 20, 2014

Could this be related to Chrome on iOS bug https://code.google.com/p/chromium/issues/detail?id=346504 ?

@jpillora jpillora added the bug label Aug 20, 2014
@xoob
Copy link

xoob commented Aug 30, 2014

This bug is described in the second part of this New Relic blog post. They encountered the same issue with their in-page tracking.

http://blog.newrelic.com/2014/04/11/crazy-things-found-developing-new-relic-browser/

Chrome was making AJAX requests to http://localhost:0/chromecheckurl, and this request was failing somehow.

It turns out that as part of a workaround for having to build Chrome for iOS on top of the built-in iOS WebKit engine, the browser needs to use some tricks, such as using AJAX to hit a local HTTP endpoint, to do things like URL verification. Our instrumentation was somehow triggering a bug that caused Chrome for iOS to believe that valid URLs were bad. For now, we have disabled AJAX timing for Chrome for iOS, but we plan to bring it back soon with workarounds for this issue.

@jpillora
Copy link
Owner

Thanks for the link, I commented earlier on a chromium bug which mentioned new relic. I just did some deeper debugging, it seems this http://localhost:0/chromecheckurl request is synchronous, which should normally cause XHook to throw. I've allowed sync requests to fix this, (though when the request is sync, async hooks must be skipped). Testing now...

@jpillora
Copy link
Owner

Pushed XHook 1.2.2 and XDomain 0.6.13. I think that fixed it. Everyone on this thread – can you please test http://jpillora.com/xdomain/ on Chrome on your iPhones. Will close once we get a few confirmations.

@xoob
Copy link

xoob commented Aug 30, 2014

Confirmed, this page is working without the warning now.

@jpillora
Copy link
Owner

Awesome, well it's fixed for me too, so I'll close and we can reopen if someone else has a problem.

@RobCherry
Copy link

It appears to be fixed for me as well. Thank you @jpillora.

@pedrosanta
Copy link
Author

Yep, it fixed it for me too. Thanks @jpillora.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants