简体   繁体   中英

Window.open opening tab instead of popup in Opera?

I'm simply opening a popup from JavaScript with the settings you can see in the code. Works fine in Firefox. In Opera it's opening it in a new tab instead. Why?

Here's a JSFiddle: http://jsfiddle.net/hafWs/3/

The number of parameters doesn't seem to make a difference. Either work in Firefox and IE8. (Don't have IE9 or Chrome to test right now.)

I tried googling... can't find anything. I don't even see anything here that mentions it, yet it's clearly working in their examples: http://www.quirksmode.org/js/popup.html

Thank you for any help.

This is controlled by the browser itself (preferences) and cannot be changed from JavaScript.

NOTE: I've seen some posts that say you can determine whether the window opens in a tab or as a new window based on the parameters that you pass the window.open function. I have never seen this work consistently.

There is problem with spaces in options param:

window.showPopup = function(){
    window.open(
        'http://placekitten.com/600/500',
        'thePopup',
        'width=600,height=500' /* <------- Look, no spaces and works */
    );
}

It is still a tab, but with different dimensions. So, it looks kinda as popup.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM