Reputation: 4462
I have a code that used to open a popup window in all browsers, but now chrome started opening a new tab instead.
Does anyone knows what did they change and how do I open a popup window now?
This is my code:
function openWindow(url, title) {
window.open(url, title, 'height=640,width=960,toolbar=no,menubar=no,scrollbars=no,location=no,status=no');
}
Upvotes: 5
Views: 13487
Reputation: 11
It might not be obvious, but for those who still needs the solution and that issue happens only on macOS, most probably it works as intended, but it is likely you are using the full screen mode on your Mac - and the link being opened in new tab, because due to some “expected” OS behavior the new window cannot be opened and showed while you are in full screen mode. Try to exit the full screen mode and that code should work fine opening the link in new window.
Upvotes: 1
Reputation: 2352
This seems to happen whenever you pass an invalid comma delimited "settings string" as your 3rd (settings) param, i.e. window.open(url, window_title, settings)
.
So, check your spelling, look for errors, make sure you haven't specified (passed in) incorrect/incompatible options in that string.
It seems when this happens the window.open()
call will just ignore the whole OPEN IN A NEW WINDOW concept, and just opens the specified URL (as best it can retrieve it) in a new/next tab.
Upvotes: 0
Reputation: 4925
Could you try this code please?
function openWindow(url, title) {
var myWindow = window.open(url, title, "height=640,width=960,toolbar=no,menubar=no,scrollbars=no,location=no,status=no");
}
Working example: https://jsfiddle.net/C0dekid/go96uk5r/5/
Upvotes: 2
Reputation: 735
This is working for me:
window.open('https://www.google.com', 'MyWindow1', "height=640,width=960,toolbar=no,menubar=no,scrollbars=no,location=no,status=no");
What is your Chrome version?
My version is 49.0.2623.87 m
Upvotes: 1