Closed Bug 1126164 Opened 10 years ago Closed 10 years ago

Using window.open in allowed events handler will sometimes trigger popup blocker.

Categories

(Core :: DOM: Events, defect)

36 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla38
Tracking Status
firefox35 --- unaffected
firefox36 + fixed
firefox37 + fixed
firefox38 + fixed

People

(Reporter: hectorz, Assigned: jimm)

References

(Blocks 1 open bug)

Details

(Keywords: regression)

Attachments

(1 file, 3 obsolete files)

"sometimes" means: 1. On Fx 36+ 2. window.open is called in the load handler of a sync ajax initiated in the event handler, as discussed in [1]; 3. a plugin is loaded in the current browser window. A minimal test case is available at [2], clicking "Sync!" on Fx 35 will open a new tab, but trigger a popup blocker on Fx 36+. Regression range on Nightly channel is [3]. This technique is used by a major Chinese website alipay (similar to PayPal), so it's important to fix it before Fx 36 reach release. [1]: http://stackoverflow.com/a/9514875 [2]: http://people.mozilla.org/~bzhao/sync-ajax-popup-blocker.html [3]: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=688f821edcd4&tochange=ab137ddd3746
Hector, I assume <embed> in the testcase is needed? I can't seem to reproduce this on Linux, but can on Windows. My guess would be some of those plugin changes in the regression range.
(In reply to Olli Pettay [:smaug] from comment #1) > Hector, I assume <embed> in the testcase is needed? Yes, it's needed. However, it doesn't have to be in the same tab of the |window.open| call, a plugin in any tab within the same tabbrowser would be enough to trigger the popup blocker.
Tracking for site compat. Olli - As you can reproduce the bug, can you take this bug?
Flags: needinfo?(bugs)
I'm not familiar with Windows specific stuff and this is a regression from Bug 669200.
Flags: needinfo?(bugs)
Thanks Olli. Jim - You're the assignee on bug 669200. Can you take this one?
Flags: needinfo?(jmathies)
"Make the ajax call synchronous, which is something you should normally avoid like the plague as it locks up the UI of the browser." not sure we would want this fixed after reading that, but ok! :)
Assignee: nobody → jmathies
Flags: needinfo?(jmathies)
Attached patch patch (obsolete) (deleted) — Splinter Review
This was introduced in this patch - https://bugzilla.mozilla.org/attachment.cgi?id=8521433&action=diff Where I removed an optimization in win32 nsWindow's SetWindowClipRegion that early returned if the stored clip rects were equal to the incoming array. This triggered some additional WINDOWPOSCHANGING events, which triggered some funny code in the plugin instance subclass here - http://mxr.mozilla.org/mozilla-central/source/dom/plugins/base/nsPluginNativeWindowWin.cpp#352 which altered the global popup detection state.
Attached patch patch (obsolete) (deleted) — Splinter Review
Attachment #8555813 - Attachment is obsolete: true
Attachment #8555824 - Flags: review?(roc)
Comment on attachment 8555824 [details] [diff] [review] patch this regressed something with initial plugin window display + non-e10s.
Attachment #8555824 - Flags: review?(roc)
Comment on attachment 8555824 [details] [diff] [review] patch Review of attachment 8555824 [details] [diff] [review]: ----------------------------------------------------------------- ::: widget/nsBaseWidget.cpp @@ +646,5 @@ > > bool > +nsBaseWidget::IsWindowClipRegionEqual(const nsTArray<nsIntRect>& aRects) > +{ > + if (!aRects.Length() && !mClipRects) { We can't do this, if mClipRects is null, GetWindowClipRegion returns the bounds, which triggers the regression I'm seeing. If mClipRects is null, we should return false.
Attached patch patch (obsolete) (deleted) — Splinter Review
Attachment #8555824 - Attachment is obsolete: true
Attachment #8555885 - Flags: review?(roc)
Attached patch patch r=roc (deleted) — Splinter Review
Attachment #8555885 - Attachment is obsolete: true
try push in comment 9.
Keywords: checkin-needed
Flags: needinfo?(jmathies)
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Comment on attachment 8556123 [details] [diff] [review] patch r=roc Approval Request Comment [Feature/regressing bug #]: regression caused by bug 669200 [User impact if declined]: buggy popup blocking. [Describe test coverage new/current, TreeHerder]: on mc for a couple days. [Risks and why]: low risk, and we can't back out bug 669200, so we should fix. [String/UUID change made/needed]: none.
Flags: needinfo?(jmathies)
Attachment #8556123 - Flags: approval-mozilla-aurora?
Jim, any reason why you didn't ask for an uplift request to beta?
Flags: needinfo?(jmathies)
Comment on attachment 8556123 [details] [diff] [review] patch r=roc Didn't realize this was needed on beta.
Flags: needinfo?(jmathies)
Attachment #8556123 - Flags: approval-mozilla-beta?
Attachment #8556123 - Flags: approval-mozilla-beta?
Attachment #8556123 - Flags: approval-mozilla-beta+
Attachment #8556123 - Flags: approval-mozilla-aurora?
Attachment #8556123 - Flags: approval-mozilla-aurora+
Thanks!
QA Whiteboard: [good first verify]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: