How to window.open with a toolbar in Google Chrome?

19,688

Solution 1

Unfortunately Chrome only supports a small set of window features when using window.open. If you believe that this is a bug or an issue you can file it at [http://crbug.com].

If you just use window.open(url) then it will open a new tab in the same window with the buttons you desire.

Solution 2

There is a bug open for Chrome: https://code.google.com/p/chromium/issues/detail?id=82522

It has not received a lot of attention from Google. Vote for it.

Solution 3

Updating on current behavior (as of 4/26/2017)

The expected behavior should be a new PopUp Window when size dimensions are passed as arguments to window.open (if toolbar is enabled, then add the toolbar to the PopUp window). If no dimensions are indicated just default to opening a new tab (in this case toolbar enabled is the default). (Btw, this is FF current Behavior (version 54.0a2)) .

Chrome Behavior (Canary 60.0.3079.0)

Opens PopUp Window to indicated dimensions window.open("https://google.com","foo","width=800, height=780")

Opens New Tab (browsers default minimized size, ignores size dimensions) window.open("https://google.com","foo","width=800, height=780,toolbar=1")

FF Behavior

w/Size Dimensions Opens PopUp Window w/o ToolBar (NO toolbar) window.open("https://google.com","foo","width=800, height=780")

Opens PopUp with ToolBar window.open("https://google.com","foo","width=800, height=780, toolbar=1")

w/o dimensions Opens New Tab window.open("https://google.com","foo") window.open("https://google.com","foo", "toolbar=1")

Solution 4

The only option for Chrome is to not specify a third argument. Chrome ignores the third argument as they are rightly allowed to do according to the HTML 5 specification, but if present the window appears to always open in a floating widow without controls.

If you do not specify a third argument the window that opens will be a new tab and will have all of the features the user needs.

If you do specify a third argument you will get a new floating window with no controls other than the URL display.

Share:
19,688

Related videos on Youtube

brahn
Author by

brahn

Updated on June 08, 2020

Comments

  • brahn
    brahn almost 4 years

    The following javascript opens a pop-up in Firefox, Safari, IE, and Google Chrome:

    window.open("http://google.com", "foo", "toolbar=yes,location=yes,menubar=yes")
    

    However, in Google Chrome the toolbar (with the usual forward and back buttons, etc.) does not appear on the popped-up window. (Tested on both Windows and Mac.)

    How can I fix this? I would like the user to be able to navigate forward and back using the tools with which they are most familiar.

  • brahn
    brahn about 14 years
    Thanks! Is there a preferred way to open a pop-up in Chrome that would permit a toolbar?
  • Andy Baker
    Andy Baker over 9 years
    I'm rather on Google's side on this one. I'd quite like all new tab opening to be disabled. That would force users to learn how to choose for themselves (alt or right click) and it would force websites to think of a better UX. Popups are universally user-hostile or at best badly-thought-out UI.
  • Nope
    Nope over 6 years
    While raised as a bug, it isn't one. Google intentionally design it that way as they want you to use tabs as default and design your own popup solutions if you desire so.
  • Nope
    Nope over 6 years
    That behavior is most likely not going to change as google intentionally designed it that way. As far as I know they want you to use tabs if you want full toolbar control and not popup windows, something to do with how popup windows are easily misused for hostile intend.
  • Nope
    Nope over 6 years
    @brahn Yes, Google wants you to use tabs for that.
  • underdog
    underdog almost 6 years
    I worked in many places where if a piece of software failed to conform to the agreed upon specification, we called it a "bug". The size of the company makes us call it a "feature". w3.org/TR/html5/browsers.html#the-toolbar-barprop-object

Related