HubSpot / offline

Automatically display online/offline indication to your users
http://github.hubspot.com/offline/docs/welcome
MIT License
8.66k stars 847 forks source link

Offlinejs conflicting with Opentok Library #193

Open abhishekgahlot opened 8 years ago

abhishekgahlot commented 8 years ago

In opentok.js somewhere its checked whether a variable is instanceof XMLHttpRequest but as Offlinejs is modifying XMLHttpRequest that gives false instead of true.

https://forums.tokbox.com/javascript/tokbox-and-offline-js-conflict-t45928

What would be the ideal fix for this. How about checking the prototype. Currently I am using Object.getPrototypeof(variable)

timsuchanek commented 8 years ago

Having the same issue here. Any idea how to fix that problem?

screen shot 2016-06-14 at 2 04 17 pm
timsuchanek commented 8 years ago

Is it really necessary to modify the XMLHttpRequest for a library that gives you an offline indicator?

abhishekgahlot commented 8 years ago

@timsuchanek We fixed this by checking the prototype using.

var someVar = new XMLHttpRequest();
(global.XMLHttpRequest && Object.getPrototypeOf(selector) == Object.getPrototypeOf(someVar))

in opentok library. Where initially it was checking instanceOf.

Pchol commented 7 years ago

Set Offline.options.interceptRequests = false and Offline.options.requests = false.

arrauf commented 4 years ago

I am using offline@0.7.19. Opentok.js was working fine before adding it to my project. After adding, it is giving me the same error as in this issue was asked.

Having the same issue here. Any idea how to fix that problem?

screen shot 2016-06-14 at 2 04 17 pm