The other answers are outdated. The behavior of Chrome for window.open depends on where it is called from. See also this topic.
When window.open is called from a handler that was triggered though a user action (e.g. onclick event), it will behave similar as <a target="_blank">, which by default opens in a new tab. However if window.open is called elsewhere, Chrome ignores other arguments and always opens a new window with a non-editable address bar.
This looks like some kind of security measure, although the rationale behind it is not completely clear.
Answer from Jeroen Ooms on Stack OverflowThe other answers are outdated. The behavior of Chrome for window.open depends on where it is called from. See also this topic.
When window.open is called from a handler that was triggered though a user action (e.g. onclick event), it will behave similar as <a target="_blank">, which by default opens in a new tab. However if window.open is called elsewhere, Chrome ignores other arguments and always opens a new window with a non-editable address bar.
This looks like some kind of security measure, although the rationale behind it is not completely clear.
This worked for me:
newwindow = window.open(url, "_blank", "resizable=yes, scrollbars=yes, titlebar=yes, width=800, height=900, top=10, left=10");
Window.open() not work in Google Chrome - JavaScript
Android help, tabs stuck on a window that won't open?
Can not open a website in a new dedicated window anymore - Google Chrome Community
"Open as window" option missing when I save a shortcut - Google Chrome Community
Videos
Per https://developer.mozilla.org/en-US/docs/Web/API/Window/open
It appears you need the second param.
window.open(url, windowName, [windowFeatures]);
openWindow(info) {
window.open('http://10.100.100.100:9999/window?someInfo=' + info, '_blank');
},
I was lodged here on search.
I faced such issue only on mobile chrome.
The two param didn't work for me. So i used 3 params.
openWindow(info) {
window.open('http://10.100.100.100:9999/window?someInfo=' + info, '_blank', 'popup=1');
}
or
openWindow(info) {
window.open('http://10.100.100.100:9999/window?someInfo=' + info, '_blank', '');
}
At first I thought my tabs were nuked, but turns out they are just on a separate window. Whew. Okay, I'll just swap to the window with all my tabs. Nope. It made a new window side by side instead. No matter what I do, I can't seem to access this window with 30 some tabs?
I am trying to create a temporary fix for this highly-annoying bug:
https://www.reddit.com/r/help/comments/13o7yif/why_does_reddit_open_image_links_in_their/
The solution to bust the proprietary image viewer is to open the image URL in a new tab and then close the current tab:
//Check to see if the image is being loaded in Reddit's proprietary image viewer. If the element exists, open the URL in a new tab and then close the current.
let elImg = document.querySelector("img.object-contain");
if (elImg) {
window.open(elImg.src,"_blank");
window.close();
}This works great when executed in the dev console directly, but Brave blocks it as a pop-up when it's executed by my Tampermonkey userscript. Is there a way to somehow trust the userscript source? Or perhaps there is another way to open a URL in a new tab without being blocked?
Update: While not an ideal solution, this does work:
let elImg = document.querySelector("img.object-contain");
if (elImg) {
elImg.addEventListener("click", function() {
window.open(this.src,"_blank");
window.close();
});
}It turns out that pop-ups are blocked when not executed by a user action. If I invoke the code by adding a click event to the element, it will work. However, I am still looking for a way to execute the code when the page loads.
Posting this because Chrome wouldn't even open — no window, no error message — and I couldn't find a working fix until now. It was running in the background, but nothing showed up in Task Manager. Reinstalling didn’t help. Here's what worked for me (Need help? Copy these instructions in ChatGPT so the tool guides you).
Please comment if this helped or if you found another solution that worked! Let's help others who might be facing this issue.
Enable hidden folders:
Open File Explorer and go to the
Viewtab.Check the box that says Hidden items to show hidden folders.
Navigate to Chrome’s data folder:
Press
Win + R, type this and press Enter:%LOCALAPPDATA%\Google\ChromeYou should see the folder where Chrome stores its data. If you can't see it, enable the "Hidden items" option as mentioned earlier.
Delete the Chrome folder:
Delete the entire Chrome folder. This will remove your profile data, which may be corrupted.
Uninstall Chrome:
Go to Control Panel > Programs > Uninstall a Program.
Find Google Chrome and uninstall it.
Reinstall Chrome:
Download the latest version of Chrome from the official website and install it.
i am trying to open chrome however, when i open it the browser itself doesn’t show up. it shows that chrome is open in the taskbar but the actual screen for the browser is not opening when i click on it. i have tried uninstalling and reinstalling but nothing is working. it was also working fine last night before i went to bed and now it is not working at all. pls help.