WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 19418
21699
onbeforeunload/onunload should fire on frames/iframes
https://bugs.webkit.org/show_bug.cgi?id=21699
Summary
onbeforeunload/onunload should fire on frames/iframes
Ojan Vafai
Reported
2008-10-16 18:10:21 PDT
Testcase coming.
Attachments
reduced testcase
(315 bytes, text/html)
2008-10-16 18:33 PDT
,
Ojan Vafai
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Ojan Vafai
Comment 1
2008-10-16 18:33:11 PDT
Created
attachment 24449
[details]
reduced testcase page with an iframe that has an onbeforeunload handler. attempting to leave the page should popup the beforeunload dialog.
Ted Rust
Comment 2
2008-11-08 17:14:51 PST
This looks like a duplicate of
bug #19418
.
Alexey Proskuryakov
Comment 3
2008-11-11 02:44:41 PST
See also:
bug 15652
.
Alexey Proskuryakov
Comment 4
2008-11-15 02:22:37 PST
Confirmed with
r38387
. In
bug #19418
, the handler is installed on the body of iframe document, while here, it is installed on Window object. So, these bugs are not exact duplicates, keeping them separate for now.
Alexey Proskuryakov
Comment 5
2008-11-15 02:29:51 PST
Note however that fixing this may give a way to ads in iframes to be even more nasty than they are now, and open windows when navigating away from a page with an ad. They could be other undesirable consequences, as well.
Dan POPA
Comment 6
2009-04-29 02:48:59 PDT
(In reply to
comment #5
)
> Note however that fixing this may give a way to ads in iframes to be even more > nasty than they are now, and open windows when navigating away from a page with > an ad. They could be other undesirable consequences, as well. >
From your argument I can see you are against people having guns, because, you say, some will start shooting other people. The beforeunload event could be abused in the same way as the unload event. People already have methods of killing other people. If the beforeunload event does not trigger for iframes, developers have no way of stopping a navigation inside an IFRAME so the user will not have a chance to save their work. I'm not saying having guns is a good thing, I'm just saying that the beforeunload is really useful.
Maciej Stachowiak
Comment 7
2009-06-16 14:58:42 PDT
I'm told (though I haven't tested) that IE and Firefox allow this. The HTML5 spec also describes beforeunload in some detail.
William J. Edney
Comment 8
2009-06-16 15:10:13 PDT
Maciej - Yes, I know for a fact that IE and FF allow this, because I use it all day, every day. For Webkit-based browsers, I had to play major workaround games to get this to work. Cheers, - Bill
Oliver Hunt
Comment 9
2009-07-16 02:40:08 PDT
*** This bug has been marked as a duplicate of
bug 19418
***
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug