-
Notifications
You must be signed in to change notification settings - Fork 2k
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
addEventListener beforeunload not working #445
Comments
Are you setting |
This is the function which is called: function(a) {
try {
if (!this.id) {
return
}
var b = this.opaqueElement;
if (this.isIgnored(b)) {
return
}
if (b) {
this.click(b);
this.opaqueElement = null
}
} catch (c) {}
} Thanks! =) |
I don't see where you are setting |
Actually, it's a third party library that is adding the listener and it only works in the right domain. So I don't think I can properly make a jsbin. But if I remove polymer it works.. =T |
Does it work in Firefox without polymer? (Chrome used to have an extension to addEventListener) |
I can reproduce weirdness... not the same issue as you are seeing though. I get "false" instead of the string that I want. |
Yep, I am getting false too =) Seems that it happens only in chrome and safari.. |
I can explain the false one. That is Chrome doing the wrong thing with the return value. I noticed that BeforeUnloadEvent was never registered. I'm debugging now. I expect to have this fixed today. |
I am trying to test it and see if it works for me, how can I use your pr? |
@pasviegas Just merged this in, sorry for the delay. |
Working, thanks a lot! |
Hey, I am using a external library that uses setInterval and adds a beforeunload listener to clean it before leaving the page. But thats not happening, so it is causing the user to be prompted a message before leaving.
It seems that polymer is overriding the addEventListener and not firing the beforeunload properly.
Is it a known issue? Is there any fix?
Thanks a lot.
The text was updated successfully, but these errors were encountered: