Re: Issue 4422 in chromium: onbeforeunload related bug (both Chrome and Safari)

152 views
Skip to first unread message

chro...@googlecode.com

unread,
Mar 6, 2010, 7:09:12 AM3/6/10
to chromi...@chromium.org

Comment #29 on issue 4422 by krudtaa: onbeforeunload related bug (both
Chrome and Safari)
http://code.google.com/p/chromium/issues/detail?id=4422

Hi

This bug:
https://bugs.webkit.org/show_bug.cgi?id=26211

are still present in the just released Chrome beta version 4.1.249.1025

A fix is much wanted.... (this bug is getting quite old now... or?)

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

chro...@googlecode.com

unread,
Apr 15, 2010, 7:21:07 AM4/15/10
to chromi...@chromium.org

Comment #31 on issue 4422 by mrafaqi: onbeforeunload related bug (both

I am also using Chrome 5.0.342.9 beta. Issue is simple yet annoying.
onbeforeunload event is perfectly
implemented in IE (proprietary) and Firefox. The problem is mainly with
Chrome and Safari (I am using Mac OS
X so not sure if it exists on windows as well or not).

It is possible in IE and FF to simply cancel the page unload by pressing
cancel in the warning dialog which is
generated using returning a string. Chrome and Safari both must be handled
separately within onbeforeunload
event. I create a confirm dialog for both of these browsers and if the user
presses cancel, it must not unload
(return false or ...) however it still does. I don't know but Google has
somewhat similar feature implemented in
Google Docs which works fine there (obviously). Has anyone a workaround ?

chro...@googlecode.com

unread,
Oct 2, 2010, 10:38:30 AM10/2/10
to chromi...@chromium.org

Comment #38 on issue 4422 by ricky2k7: onbeforeunload related bug (both

I have a parent window button that needs to trigger a onbeforeunload event
in a iFrame.
Working perfectly in IE and FF, but in Chrome it doesn't do anything :(

Has there been any fixes or hacks for this issue?

chro...@googlecode.com

unread,
Oct 6, 2010, 9:55:03 AM10/6/10
to chromi...@chromium.org

Comment #39 on issue 4422 by niels.giesen: onbeforeunload related bug (both

For me, the event does get fired in 6.0.472.63 when the window is the top
one, but not when inside an iframe.

I have attached two very simple files to test this. When navigating away
from iframe.html, a confirm box is shown, but not when it is iframed inside
outer.html.

Attachments:
onbeforeunloadtest.zip 870 bytes

chro...@googlecode.com

unread,
Oct 12, 2010, 4:30:48 AM10/12/10
to chromi...@chromium.org

Comment #41 on issue 4422 by Michele.Nencioli: onbeforeunload related bug

We need solution for this bug!! We don't want to use IE for our application.
P

chro...@googlecode.com

unread,
Oct 13, 2010, 8:54:30 PM10/13/10
to chromi...@chromium.org

Comment #42 on issue 4422 by ucimeup: onbeforeunload related bug (both

The following html works in firefox 3.6.10 but not 6.0.472.63. I'm using
GWT's Window.addWindowClosingHandler, which doesn't work in Chrome either.

<html>
<head>
<script>
function init() {
var iframe = document.getElementById("test_iframe");
iframe.contentWindow.addEventListener("beforeunload", function()
{alert("unloading")}, false);
}
</script>

</head>
<body onload="init()">
<iframe id="test_iframe"></iframe>
</body>
</html>

chro...@googlecode.com

unread,
Dec 1, 2010, 7:58:19 AM12/1/10
to chromi...@chromium.org

Comment #43 on issue 4422 by childerskc: onbeforeunload related bug (both

Wow, I all around LOVE Google, but I must say, for 'this' issue to go on
for 2 years and not as much as a "We're Working On It" disappoints me.
Since this issue has not yet been resolved, I must encourage users to use
browsers I don't use myself outside of developing, as my application(s)
wont properly close in Chrome. Google has how many developers, and not 1
can atleast look into the bug?


chro...@googlecode.com

unread,
Dec 30, 2010, 4:56:23 AM12/30/10
to chromi...@chromium.org

Comment #44 on issue 4422 by assafla...@gmail.com: onbeforeunload related

Tested right now with the latest stable Chrome (8) and onbeforeunload
simply never fires.
onunload does work, but is too late to be useful in very common scenarios.


chro...@googlecode.com

unread,
Jan 12, 2011, 1:21:09 AM1/12/11
to chromi...@chromium.org

Comment #45 on issue 4422 by vanensat: onbeforeunload related bug (both

The onbeforeunload event works in Chrome beta 9.0.597.47. Hope this
continues working on stable build too.

@ Google Dev: Is the Safari defect
https://bugs.webkit.org/show_bug.cgi?id=19418# the external dependency? It
got resolved recently.

chro...@googlecode.com

unread,
Jan 12, 2011, 1:37:31 AM1/12/11
to chromi...@chromium.org

Comment #46 on issue 4422 by vanensat: onbeforeunload related bug (both

Is the Safari defect https://bugs.webkit.org/show_bug.cgi?id=19418# the

external dependency? It got resolved recently.

This defect blocks us from getting a customer to use Chrome to leverage the
performance benefits!! Could you pay attention to this case?

chro...@googlecode.com

unread,
May 3, 2011, 9:34:38 AM5/3/11
to chromi...@chromium.org

Comment #47 on issue 4422 by shen...@gmail.com: onbeforeunload related bug

I'm using the latest version of Google Chrome (11.0.696.60) and I've been
able to replicate this annoying BUG. The bug seems to be fixed for pages
without frames but it still exists if the onbeforeunload is used within a
Frame or an IFrame.
This is a test page:
http://lab.openwebspider.org/ows_lab/chrome_obu_bug/


chro...@googlecode.com

unread,
Jun 9, 2011, 3:28:26 AM6/9/11
to chromi...@chromium.org

Comment #48 on issue 4422 by rahul....@gmail.com: onbeforeunload related

I have checked in 12.0.742.91 Version of Google Chrome.This Issue still
exists in this version too...

chro...@googlecode.com

unread,
Sep 27, 2011, 10:28:37 AM9/27/11
to chromi...@chromium.org

Comment #49 on issue 4422 by g.kar...@gmail.com: onbeforeunload related bug

It is still there in v14.0.835.186
I do not understand why the chromium team hasn't got around to solving this
for the last two years. The issue dates back to 2009

chro...@googlecode.com

unread,
Oct 13, 2011, 7:07:36 AM10/13/11
to chromi...@chromium.org

Comment #50 on issue 4422 by abuabdul...@gmail.com: onbeforeunload related

I am using

window.onbeforeunload = function () { alert("chrome OnBeforeUnload test"); }

but it is not working in Chrome. It works fine in IE.

I am using Chrome version 14.0.835.202

chro...@googlecode.com

unread,
Nov 12, 2011, 10:00:41 AM11/12/11
to chromi...@chromium.org

Comment #51 on issue 4422 by euautoma...@gmail.com: onbeforeunload related

Still not fixed yet? This is a vital function for many web apps that
perform clean up operations in certain scenarios.

chro...@googlecode.com

unread,
Nov 25, 2011, 12:32:34 PM11/25/11
to chromi...@chromium.org

Comment #53 on issue 4422 by andyjuli...@gmail.com: onbeforeunload related

the return 'blahblah' can prompt,and other functions works before the
return with the parameters. Any other scenario will not work.
I think Chrome browser may be close the window too fast and not time to run
the code if there is no popup pause the window closing.
Please fix!!!

chro...@googlecode.com

unread,
Jan 9, 2012, 7:40:29 PM1/9/12
to chromi...@chromium.org

Comment #54 on issue 4422 by danocarr...@gmail.com: onbeforeunload related
I´m loosing time and money because of this bug, I hope someone fixed this
rigth now!!
This is working in firefox and in IE(WTFFFF!!!!!)[YES I SAID IE] but not in
chrome. Shame on all developer chrome team!!

chro...@googlecode.com

unread,
Jan 12, 2012, 11:04:53 PM1/12/12
to chromi...@chromium.org

Comment #55 on issue 4422 by perez.x...@gmail.com: onbeforeunload related
cant believe this is not fixed yet, i´m using chrome 16

chro...@googlecode.com

unread,
Jan 13, 2012, 7:42:25 AM1/13/12
to chromi...@chromium.org

Comment #56 on issue 4422 by jun1...@gmail.com: onbeforeunload related bug
it works at 10.0.648.18
--
<HTML>
<head>
<title>test</title>
</head>
<body>

<script>
window.onbeforeunload = function(){ alert("bye"); }
</script>
</body>
</html>
--

Attachments:
呿.jpg 3.9 KB

chro...@googlecode.com

unread,
Jan 17, 2012, 1:53:08 AM1/17/12
to chromi...@chromium.org

Comment #58 on issue 4422 by drw.anal...@gmail.com: onbeforeunload related

Wow I cannot believe this issue has been around for so long..I recently
switched to chrome from Fire Fox and absolutely love it and today I found
this issue which apparently works in all other major browsers..Someone
please fix this bug, we use onbeforeunload in our applications to track
data...

chro...@googlecode.com

unread,
Mar 13, 2012, 10:28:29 AM3/13/12
to chromi...@chromium.org

Comment #63 on issue 4422 by 334136...@qq.com: onbeforeunload related bug

The chrome not support Javascript onunload() and onbeforunload();but
onload() we can used;
So we combine with Cookie can achieve the function what you want to do !
when you open a new page first,it trigger onload();
we use save The url to Cookie , when you refresh in the same page , the
url is equal.
when you jump to other page ,from Javascript get url then url is not equal
the url in cookies
so , you can do what you want to do !
Mail: 3341...@qq.com


Attachments:
onunload().zip 4.5 KB

chro...@googlecode.com

unread,
May 31, 2012, 3:20:33 AM5/31/12
to chromi...@chromium.org

Comment #64 on issue 4422 by wangye7...@gmail.com: onbeforeunload related
you can use onbeforeunload like this:

window.onbeforeunload = function(){ return "xxxxxx"; }

console or alert is not supported in the onbeforeunload.

and ajax post code can be executed .



chro...@googlecode.com

unread,
Oct 10, 2012, 11:44:55 PM10/10/12
to chromi...@chromium.org

Comment #65 on issue 4422 by kaienk...@gmail.com: onbeforeunload related
I don't know why chrome make itself so "special", WTF!!!!!!!

chro...@googlecode.com

unread,
Nov 23, 2012, 9:34:36 PM11/23/12
to chromi...@chromium.org

Comment #66 on issue 4422 by leebill...@gmail.com: onbeforeunload related
It still here Chrome v22.

chro...@googlecode.com

unread,
Dec 12, 2012, 3:32:03 PM12/12/12
to chromi...@chromium.org

Comment #67 on issue 4422 by google_...@omegashop-br.com: onbeforeunload
related bug (both Chrome and Safari)
http://code.google.com/p/chromium/issues/detail?id=4422

is there any forecast to solve the problem of onbeforeunload? Applications
that require close monitoring, record charts, need this essential
functionality.
We have applications that record at the close tables in databases, send
e-mail and other functions and onbeforeunload resolves these issues,
especially when the user simply closes the browser by the control box.
onbeforeunload assists in managing critical applications.

chro...@googlecode.com

unread,
Jan 28, 2013, 9:11:30 PM1/28/13
to chromi...@chromium.org

Comment #68 on issue 4422 by wenjie.z...@gmail.com: onbeforeunload related
Shit, it cost me lots of hour to debug js code.

chro...@googlecode.com

unread,
Jan 28, 2013, 10:13:34 PM1/28/13
to chromi...@chromium.org

Comment #69 on issue 4422 by wenjie.z...@gmail.com: onbeforeunload related
My god, it costs me lots of hours to debug my js code. Hope chrome team can
make this work very soon.

chro...@googlecode.com

unread,
Mar 20, 2013, 7:55:46 AM3/20/13
to chromi...@chromium.org

Comment #71 on issue 4422 by vijaypat...@gmail.com: onbeforeunload related
When we are closing the window in google chrome and in onbefore unload if
we perform any jquery ajax operation and on basis of result of that ajax
request if you want to reload or redirect parent page in this case google
chrome is fail.

When you click on the close window google chrome is start the execution of
jquery ajax but it is not waiting for response even you did async = false.
and it will move forward and finally it will not execute your script.

I have spent lots of effort for the solution but no luck.

Other browser ie , ff are working fine.

any solution from google ?

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

chro...@googlecode.com

unread,
Apr 7, 2013, 10:27:38 PM4/7/13
to chromi...@chromium.org

Comment #73 on issue 4422 by dingyong...@gmail.com: onbeforeunload related
Our team will on the top of world if this bug can be fixed. :)

chro...@googlecode.com

unread,
Sep 10, 2013, 4:13:55 AM9/10/13
to chromi...@chromium.org
Updates:
Status: Fixed
Cc: -mbel...@chromium.org

Comment #74 on issue 4422 by phist...@chromium.org: onbeforeunload related
I have tested through the test cases from the original description to the
last provided one. I cannot reproduce any of them.

Regarding comments 30, 39, 42, 50, 56, 61 - see issue 97206.

https://bugs.webkit.org/show_bug.cgi?id=26211 is also marked as fixed.
Closing this as fixed.
Reply all
Reply to author
Forward
0 new messages