Closed
Bug 332901
Opened 19 years ago
Closed 19 years ago
[FIX]popup window with js redirect after onbeforeunload and window.close causes the opener window to redirect
Categories
(Core :: DOM: Core & HTML, defect, P2)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha1
People
(Reporter: martijn.martijn, Assigned: bzbarsky)
References
()
Details
(Keywords: regression, testcase)
Attachments
(1 file)
5.82 KB,
patch
|
Biesinger
:
review+
darin.moz
:
superreview+
|
Details | Diff | Splinter Review |
This is a follow-up from bug 331040, see bug 331040, comment 3.
See url testcase, it has a regression range between 2005-08-11 and 2005-08-13, so most likely a regression from bug 296639.
I'm being redirected to google with this testcase, which should not happen. You
need to allow popup windows.
Basically the source of the opened window consists of this:
<script>
window.onbeforeunload=function() {window.close();}
window.location="http://google.com";
</script>
![]() |
Assignee | |
Comment 1•19 years ago
|
||
darin, biesi, what do you think of my proposed fix in bug 332901 comment 10?
Reporter | ||
Comment 2•19 years ago
|
||
(In reply to comment #1)
> darin, biesi, what do you think of my proposed fix in bug 332901 comment 10?
Boris meant bug 331040, comment 10, of course.
Comment 3•19 years ago
|
||
yeah, sounds good.
![]() |
Assignee | |
Comment 4•19 years ago
|
||
I'd also like to hear what you guys think of this for branch. I'm frankly not sure how safe this change is. :(
Assignee: general → bzbarsky
Status: NEW → ASSIGNED
Attachment #217504 -
Flags: superreview?(darin)
Attachment #217504 -
Flags: review?(cbiesinger)
![]() |
Assignee | |
Updated•19 years ago
|
OS: Windows XP → All
Priority: -- → P2
Hardware: PC → All
Summary: popup window with js redirect after onbeforeunload and window.close causes the opener window to redirect → [FIX]popup window with js redirect after onbeforeunload and window.close causes the opener window to redirect
Target Milestone: --- → mozilla1.9alpha
Comment 5•19 years ago
|
||
Comment on attachment 217504 [details] [diff] [review]
Something like this?
this doesn't exactly sound like a low-risk change to me...
Attachment #217504 -
Flags: review?(cbiesinger) → review+
Comment 6•19 years ago
|
||
Comment on attachment 217504 [details] [diff] [review]
Something like this?
>Index: docshell/base/nsDSURIContentListener.cpp
> NS_IMETHODIMP
> nsDSURIContentListener::OnStartURIOpen(nsIURI* aURI, PRBool* aAbortOpen)
> {
>+ // If mDocShell is null here, that means someone's starting a load
>+ // in our docshell after it's already been destroyed. Don't let
>+ // that happen.
>+ if (!mDocShell) {
>+ *aAbortOpen = PR_TRUE;
>+ return NS_OK;
>+ }
Should we emit a warning here?
sr=darin
Attachment #217504 -
Flags: superreview?(darin) → superreview+
![]() |
Assignee | |
Comment 7•19 years ago
|
||
If the load had started before the window.close() then we'd just Stop() the load with no warnings. I'm not sure it's worth warning just because the order of those two statements was reversed.
![]() |
Assignee | |
Comment 8•19 years ago
|
||
Fixed on trunk. I'm really not sure enough about the safety of this to want it for branch.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•