Can we drop window.open's feature parameter which controls UI parts visibility?
Categories
(Core :: DOM: Core & HTML, task, P3)
Tracking
()
People
(Reporter: arai, Assigned: arai)
References
(Regressed 4 open bugs, )
Details
(Keywords: dev-doc-complete, site-compat)
Attachments
(1 file, 2 obsolete files)
Separated from bug 1506655. window.open's feature parameters which controls UI parts (tabbar, menubar, toolbar, personalbar) is supported only in Firefox and IE [1], and it causes confusing behavior around UI to control visibility of those parts (bug 1506655), and also causes trouble around sessionrestore (the same bug, bug 1506655) Given the feature is not supported on other modern browsers, can we drop it? The other browser's behavior is following: * Edge * opens a window which has only location bar * hitting Ctrl+T does nothing * Chrome * opens a window which has only location bar * hitting Cmd+T opens new tab in other window * Safari * opens a window which behaves samely as normal window (has all UI parts) * hitting Cmd+T opens new tab in that window more behavior related to session store is described in bug 1506655 comment #7. Then, I think Chrome's behavior is same as Firefox when the feature is only "locationbar". So I think dropping support for them and open a window only with location bar regardless of those features is the simplest solution. [1] https://developer.mozilla.org/ja/docs/Web/API/window.open#Window_features
Assignee | ||
Comment 1•5 years ago
|
||
bz, can I have your opinion again? I think this at least won't cause much web-compat issue.
Updated•5 years ago
|
![]() |
||
Comment 2•5 years ago
|
||
I'm not quite following the proposal. What is the actual proposed behavior when the page asks for, say, "locationbar,toolbar,menubar"? What is the proposed behavior when the page asks for "locationbar,toolbar,menubar,tabbar,personalbar"? What about other feature combinations?
Assignee | ||
Comment 3•5 years ago
|
||
okay, let me check more about the combinations, and write down the proposal. hopefully in this weekend
Assignee | ||
Updated•5 years ago
|
Comment 4•5 years ago
|
||
(In reply to Tooru Fujisawa [:arai] from comment #0) > Separated from bug 1506655. > > window.open's feature parameters which controls UI parts (tabbar, menubar, > toolbar, personalbar) is supported only in Firefox and IE [1], Do we actually support all of these? I thought we only supported the toolbar feature. More precisely, toolbar=no, as toolbar=yes would be the default... > Given the feature is not supported on other modern browsers, can we drop it? > > The other browser's behavior is following: > * Edge > * opens a window which has only location bar > * hitting Ctrl+T does nothing > * Chrome > * opens a window which has only location bar > * hitting Cmd+T opens new tab in other window I'm not sure I'm following. It sounds like Chrome presents popups just like we do, and Edge too except for refusing to open a tab. Could it be that https://developer.mozilla.org/en-US/docs/Web/API/Window/open is just outdated? It lists Netscape 6, Netscape 7, and Mozilla 1.0 which I don't think any web developer cares about today...
Assignee | ||
Comment 5•5 years ago
|
||
(In reply to Dão Gottwald [::dao] from comment #4) > (In reply to Tooru Fujisawa [:arai] from comment #0) > > Separated from bug 1506655. > > > > window.open's feature parameters which controls UI parts (tabbar, menubar, > > toolbar, personalbar) is supported only in Firefox and IE [1], > > Do we actually support all of these? I thought we only supported the toolbar > feature. More precisely, toolbar=no, as toolbar=yes would be the default... yes, window.open can control the visibility of tabbar, toolbar (backward button etc), bookmark toolbar, in the opened window, and it's saved and restored across restart.
Assignee | ||
Comment 6•5 years ago
|
||
Assignee | ||
Comment 7•5 years ago
|
||
so far, here's the behavior of Chrome, Safari, and Edge. based on observation, I might overlook some other conditions. features parameter can control what to open (popup, window, tab), but the visibility of UI parts are not controllable (visible UI parts are fixed for each case) I'll prepare proposal for Firefox.
Assignee | ||
Comment 8•5 years ago
|
||
Comment on attachment 9027089 [details] Chrome, Safari, and Edge's behavior After some more tests, it turns out the behavior is a bit more complicated. here's the latest document: https://arai-a.github.io/window-open-features/ and testcase: https://arai-a.github.io/window-open-features/test.html
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 9•4 years ago
|
||
Updated https://arai-a.github.io/window-open-features/
Also added https://arai-a.github.io/window-open-features/firefox.html for Firefox's behavior and prefs
Updated•4 years ago
|
Assignee | ||
Comment 10•4 years ago
|
||
Tested on Edge Canary, and it seems to be the same behavior as Chrome.
Updated•4 years ago
|
Assignee | ||
Comment 11•3 years ago
|
||
might also have to think about BarProp.visible
.
https://html.spec.whatwg.org/multipage/window-object.html#browser-interface-elements
Chrome seems to return false
for the case that the bar is visible but features specifies the bar to be hidden.
Assignee | ||
Comment 12•3 years ago
|
||
There are some amount of code that checks if size or position is specified, and this affects where the page is loaded (new window or not)
https://searchfox.org/mozilla-central/search?q=aPositionSpecified&path=
I'm not sure modifying this here is reasonable.
If not modify, the condition for whether to open popup or not depends on whether size or position is specified,
in contrast to, chrome that doesn't check size/position, and Safari that checks only width.
Assignee | ||
Comment 13•3 years ago
|
||
dom.disable_window_open_feature.*
prefs doesn't work well with the idea.
those prefs control the effect of each feature separately, but the idea here just uses the set of features to whether to open popup or not,
so there's no controllability for each UI items.
I wonder if we can just remove the pref.
Assignee | ||
Comment 14•3 years ago
|
||
IIUC, the pref is used both for web content and privileged code.
if that's correct, I wonder if controlling the feature for priv code makes sense... (or, even, if it's used?)
Assignee | ||
Comment 15•3 years ago
|
||
Also, to align with other browsers, the effect of scrollbars
should also be removed (except for the condition as whether to open popup or not).
(failing test: https://searchfox.org/mozilla-central/source/dom/html/test/test_bug369370.html )
Assignee | ||
Comment 16•3 years ago
|
||
about BarProp
, the failing test is https://searchfox.org/mozilla-central/source/dom/tests/mochitest/bugs/test_window_bar.html
Assignee | ||
Comment 17•3 years ago
|
||
Assignee | ||
Comment 18•3 years ago
|
||
might also have to think about
BarProp.visible
.
https://html.spec.whatwg.org/multipage/window-object.html#browser-interface-elementsChrome seems to return
false
for the case that the bar is visible but features specifies the bar to be hidden.
IMO it doesn't make much sense to follow Chrome's behavior, because of session restore.
If we don't restore the feature
parameter across restart, the property will return different value after the restart,
and if we restore feature
parameter, that will cause similar confusion as current behavior.
Assignee | ||
Comment 19•3 years ago
|
||
new try run https://treeherder.mozilla.org/#/jobs?repo=try&revision=98644431f44af769470bd371b67ecda6732980ee
with:
- removed
dom.disable_window_open_feature.*
prefs - updated
BarProp
tests - updated to follow the latest proposed behavior https://arai-a.github.io/window-open-features/
Assignee | ||
Comment 20•3 years ago
|
||
Make the features parameter of window.open just a condition for whether to open
a popup or a new tab.
Also remove dom.disable_window_open_feature.* prefs.
Comment 22•3 years ago
|
||
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/6fe5ce050c0d Restrict the controllability of UI parts visibility with features parameter of window.open. r=smaug
Comment 23•3 years ago
|
||
Backed out changeset 6fe5ce050c0d (Bug 1507375) for failures in test_transformed_scrolling_repaints_3.html CLOSED TREE
Push with failure: https://treeherder.mozilla.org/#/jobs?repo=autoland&selectedJob=293811428&resultStatus=testfailed%2Cbusted%2Cexception&revision=6fe5ce050c0dfcbfaf64ce7f4770cfaa2c2a6cad
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=293811540&repo=autoland&lineNumber=21557
Backout: https://hg.mozilla.org/integration/autoland/rev/5cd032a8ac6c7cdd7fd8a4b371db27bb09a6f321
Assignee | ||
Updated•3 years ago
|
Comment 24•3 years ago
|
||
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/bf0e49a9ceff Restrict the controllability of UI parts visibility with features parameter of window.open. r=smaug
Comment 25•3 years ago
|
||
bugherder |
Assignee | ||
Comment 26•3 years ago
|
||
So far updated the following page to make it up to date, with some note about UI-parts visibility related items
https://wiki.developer.mozilla.org/en-US/docs/Web/API/Window/open
but I haven't described the details of the conditions for whether popup or not, given it's very implementation-dependent.
I guess we can add that section once the condition gets standardized, but I'd leave it to other bug.
also updated
https://wiki.developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/76
Updated•3 years ago
|
Comment 32•3 years ago
|
||
Posted site compatibility note.
Comment hidden (advocacy) |
Comment hidden (admin-reviewed, advocacy) |
Description
•