-
Notifications
You must be signed in to change notification settings - Fork 693
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
Issue with Chrome Packaged Apps. Unload event is not supported #163
Comments
Hey Lyle, it's nice to see SIP.js used in this context! We added that 'unload' listener so that navigating away from the page would cause SIP.js to automatically hang up any outstanding calls, instead of leaving the other end hanging. I looked into this briefly, and it seems like attempting to add the listener in a Chrome App doesn't actually break anything, it just prints an error message (see also sockjs/sockjs-client#223). Nevertheless, it'd be nice if this didn't happen, so if you know a way for SIP.js to detect when it's being used in a Chrome App and then refrain from adding the listener, I think we'd be happy to take a Pull Request for it. |
Hi Joseph, On Wed, Mar 25, 2015 at 9:18 AM, Joseph Frazier notifications@github.com
Where is that function documented? Since when does it exist?
Carlos |
I don't believe it's currently documented, unfortunately.
According to |
Yep. Everything seems to be working even though the error is thrown. You can detect if something is running as a Chrome app using this:
|
Out of curiosity, what happens if you try define https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Creating_and_triggering_events |
Seems to work if I declare it in debug console and manually dispatch. |
Hmm, I can create and dispatch the event, but adding the event listener still doesn't work: var event = new Event('unload');
// Listen for the event.
window.addEventListener('unload', console.log.bind(console, 'UNLOADED'), false);
// Dispatch the event.
window.dispatchEvent(event);
EDIT: I'm running this in the console of the sample Hello World app |
We're having trouble using SIP.js in a Chrome Packaged App. In Chrome Apps the
unload
event is not supported, and using it results in this error:unload is not available in packaged apps.
I think this is the offending code in SIP.js:
Any Tips?
The text was updated successfully, but these errors were encountered: