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

后端 未结 5 1669
情深已故
情深已故 2020-12-01 18:23

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

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


        
5条回答
  •  广开言路
    2020-12-01 18:43

    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")

提交回复
热议问题