Closed Bug 725502 Opened 13 years ago Closed 13 years ago

window.open with dialog=yes argument in it causes weird issue

Categories

(Firefox for Android Graveyard :: General, defect, P2)

ARM
Android
defect

Tracking

(blocking-fennec1.0 +, fennec13+)

VERIFIED FIXED
Firefox 13
Tracking Status
blocking-fennec1.0 --- +
fennec 13+ ---

People

(Reporter: martijn.martijn, Assigned: Margaret)

References

Details

(Keywords: testcase)

Attachments

(3 files)

Attached file testcase
See testcase, steps to reproduce: - Have at least 2 tabs open - Open the testcase, tap on the "windowopen dialog=yes buttononclick" button Expected result: - A new tab opens with that same page again Actual result: - No new tab is opened and you get weird issues, as if Fennec's tab management is confused. See also bug 724780 and bug 725496, there might be some relation to those bugs.
Looking at the source code, "dialog=yes" and window.find seem to call nsIDOMWindow.openDialog, which doesn't do the right thing for Fennec. Is there a way to override openDialog like we do for the nsIBrowserDOMWindow methods? What does XUL Fennec do?
tracking-fennec: --- → ?
Blocks: 730015
tracking-fennec: ? → -
mark, brad, can we get this bug triaged to block tracking-fennec+? ? This bug blocks any Fennec Native users trying to sign in on sites that implement current BrowserID flow. See bug 730015 and https://github.com/mozilla/browserid/issues/1169 for more info. Tony
tracking-fennec: - → ?
(In reply to Tony Chung [:tchung] from comment #2) > mark, brad, > can we get this bug triaged to block tracking-fennec+? ? > > This bug blocks any Fennec Native users trying to sign in on sites that > implement current BrowserID flow. > > See bug 730015 and https://github.com/mozilla/browserid/issues/1169 for more > info. > > Tony fyi, XUL fennec works fine. (up to FF11)
tracking-fennec: ? → 13+
Priority: -- → P2
blocking-fennec1.0: --- → +
(In reply to Matt Brubeck (:mbrubeck) from comment #1) > What does XUL Fennec do? The answer is: XUL Fennec fails silently with NS_ERROR_FAILURE from nsIDOMJSWindow.open. (The reason BrowserID was working on XUL Fennec is because they sniffed for the Fennec UA and used a workaround for this bug.) I think what we need here is an option (perhaps a pref?) to ignore "dialog=yes" in window.open arguments, and just treat open a non-dialog window/tab instead.
Assignee: nobody → margaret.leibovic
Attached patch patchSplinter Review
So, I spent a lot of time munging through this code to make sure we won't break anything, and I think we're okay with this approach. mbrubeck, if you think this is okay, I'll ask for review from a core reviewer. It appears the reason this was failing while other ways of opening windows was working is that we were never calling nsIWindowProvider->ProvideWindow here: http://mxr.mozilla.org/mozilla-central/source/embedding/components/windowwatcher/src/nsWindowWatcher.cpp#624 which leads to determining where we open a new window here: http://mxr.mozilla.org/mozilla-central/source/xpfe/appshell/src/nsContentTreeOwner.cpp#876 It looks like we can also miss that path by setting the chrome or modal features on the window, but we shouldn't need to worry about those because only privileged scripts can do that.
Attachment #602518 - Flags: feedback?(mbrubeck)
I should also mention that this won't affect dialogs created by the internal openDialog() methods (those flip the aDialog flag instead of relying on the aFeatures parameter).
Attachment #602518 - Flags: feedback?(mbrubeck) → feedback+
Attachment #602518 - Flags: review?(jst)
Comment on attachment 602518 [details] [diff] [review] patch We should enable the pref for XUL Fennec too.
Attachment #602766 - Flags: review?(mbrubeck)
Attachment #602766 - Flags: review?(mbrubeck) → review+
Comment on attachment 602518 [details] [diff] [review] patch Seems it'd make more sense to follow the existing preference naming scheme here, which is to say that the preference name for this new feature should be "dom.disable_window_open_feature.dialog". Does that make sense? Or am I missing something here? Other than that, this looks good. r=jst with that considered here.
Attachment #602518 - Flags: review?(jst) → review+
(In reply to Johnny Stenback (:jst, jst@mozilla.com) from comment #10) > Seems it'd make more sense to follow the existing preference naming scheme > here, which is to say that the preference name for this new feature should > be "dom.disable_window_open_feature.dialog". Does that make sense? Or am I > missing something here? I decided to name it something different because it doesn't go through the same logic in the NS_CALCULATE_CHROME_FLAG_FOR macro as all the ""dom.disable_window_open_feature." prefs, so the semantics of it are different.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 13
Verified fix on 03-12-2012 fennec nightly build using testcase from comment 1.
Status: RESOLVED → VERIFIED
I was hoping/thinking this would fix showModalDialog too, but it doesn't appear to, so I filed bug 735237 for that.
Blocks: 753555
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: