jpillora / xdomain

A pure JavaScript CORS alternative
https://jpillora.com/xdomain/
3.12k stars 270 forks source link

Issue with Chrome on iOS #76

Closed brandonparsons closed 10 years ago

brandonparsons commented 10 years ago

Please see http://stackoverflow.com/questions/23445743/stumped-re-chrome-ios-behavior

That issue could only be fixed by removing xDomain. Is there a working fix to this?

jpillora commented 10 years ago

Confirmed it's not working under Chrome iOS. Working safari iOS + desktop Chrome. Very strange... Looking into a fix...

jpillora commented 10 years ago

So, I've got a possible temporary work around:

    setTimeout(function() {
      $("#cross").load('http://s3.amazonaws.com/jpillora-usa/xdomain/data2.json');
    }, 0);

On the demo page, I've simply delayed the cross-domain load until next tick and that seemed to fix it.

I'm quite sure chrome is mistakenly thinking this is a fishing attack or something

brandonparsons commented 10 years ago

Cool - thanks. I had removed the requirement for a cross domain call (probably a better way to go in that case) but I'll have more coming up so I'll try to remember this :)

jpillora commented 10 years ago

Was debugging this a bit more. If we run:

xhook.disable(); //reverts to the native XMLHttpRequest object

right after loading xhook and xdomain, chrome doesn't error. Will look into this again when I can

mikesnare commented 10 years ago

@jpillora Any progress on this? I'm getting bit by this as well.

sheldonbaker commented 10 years ago

I'm stuck on this too - any updates?

jpillora commented 10 years ago

Hey guys, still trying to find a work around for this >.<

Since this is actually a bug with XHook, I'll lock this thread and we'll continue the conversation here: https://github.com/jpillora/xhook/issues/23

jpillora commented 10 years ago

Current work-around: https://github.com/jpillora/xhook/issues/23#issuecomment-52386759

jpillora commented 10 years ago

Update: https://github.com/jpillora/xhook/issues/23#issuecomment-53959991

jpillora commented 10 years ago

Fixed in 0.6.13