Second parameter must be the window name:
<input type="button" value="new win"
onclick="window.open('http://yahoo.com', 'mywindow', 'width=500, height=400')" />
Working fine in Chrome and Firefox:
http://jsfiddle.net/DvMy5/2/
Answer from Alex on Stack OverflowSecond parameter must be the window name:
<input type="button" value="new win"
onclick="window.open('http://yahoo.com', 'mywindow', 'width=500, height=400')" />
Working fine in Chrome and Firefox:
http://jsfiddle.net/DvMy5/2/
The second parameter should be name..Something like windowname
<input type="button" value="new win"
onclick="window.open('http://yahoo.com','windowname', 'width=500, height=400')" />
Open new browser window using "window.open" method is not working in the ForgeApp
window.open doesn't open a fresh window every time
ajax - Javascript window.open not working - Stack Overflow
Window.open not working for me
The standard popup-blocker logic contained in most browsers these days will block any calls to window.open() that are not the direct result of a user action. Code that is triggered by timers or by any asynchronous callback (like your ajax ready function) will be treated as NOT caused directly by user actions and the new popup window will generally be blocked.
You can verify this is what is happening by temporarily changing your browser's popup blocking (turning it off) and see that it then starts working.
Probably what you need to do as a work-around is to create the window upon the user action that started this thread of code and then put the content into the window when you get your ajax response. The browser will probably allow that. I know that's less desirable from a visual perspective, but you can put some temporary content in the window until the ajax response comes in (something like "loading...").
Just had this exact same issue. Just in case you wanted the code that fixed it. I used this:
newWindow = window.open("", "_blank");
request = $.ajax({ ... my request which returns a url to load ... })
request.done((function(_this) {
return function(data, textStatus, jqXHR) {
return newWindow.location = data.Url;
};
})(this));
Change the name of each window per link so the window opened on initial click won't be re-used.
I'm guessing that clicking on other links opens the links on the initial/currently opened pop-up and causes confusion that it doesn't open new windows.
// first window to open
window.open("first.html",'name','height=600,width=800');
// opens in the same window where first.html is opened because
// it targets the same window called `name`
window.open("second.html",'name','height=600,width=800');
// this works because by default it will open a new one everytime it is executed
window.open("new.html");
// opens a window with unique name
window.open("<%=forHyperLink%>",'name_' + Math.random(),'height=600,width=800');
You can use window.open("<%=forHyperLink%>",'name_'+(new Date()).getTime(),'height=600,width=800');
'name_'+(new Date()).getTime() will be changed at each window opened
oNewWindow = window.open( [sURL] [, sName] [, sFeatures] [, bReplace])
Please find the detail of window.open from the following link
http://msdn.microsoft.com/en-us/library/ms536651(v=vs.85).aspx
Confirmed with my IS department, that suggested fix for reloading in IE mode doesnt work for us.
I guess I'm stuck with having to right click and manually open in new windows each time.
Again, its a small thing, it just sucks that a feature that was once there isnt anymore.
Hello John M_043,
Thank you for your positive response, as the design issue has caused you a bad experience.
You can go to Feedback Hub to give feedback on this issue.
If there is anything not clear, please do not hesitate to let me know.
Best Regards,
Lenka-MSFT| Microsoft Community Support Specialist
Thanks for reply. None of those options worked. The problem is 50/50, some hyperlinks it works find, others hyperlinks it doesn't.
- Right clicking option is disabled (greyed out).
- Holding CTRL doesn't work either. It still opens it in a new browser window
- The problem seems to depend on the hyperlink.
- I ran the powershell option on a test PC and nothing changed.
- I know there is a way to fix this because my PC (profile) works just fine. I have a few other staff that work fine. But anytime I hire a new person or they log into the PC profile of their own, it reverts back to opening up links in a new window.
Chrome has a simple option that says (open links in a new tab), is there no simple setting option in edge? My company I'm contracted with requires us to use edge.
Hi JDSuser, welcome to the Microsoft community, my name is Bruno Leonel.
We will be happy to help and see if we can resolve this issue for you. Follow some of the recommended suggestions below that have helped others.
I understand that you are having problems opening links in a new tab and I will try to help you in the best way.
There are some possibilities to open a link in the same tab see below:
In Microsoft Edge, you can open a link in a new tab, just right-click on the link and then choose “Open in a new tab”
You can also use the Ctrl key (press it and keep it pressed) and click with the left mouse button and the link will open in a new tab.
NOTE: If the links that are opening in a new window are from the google search site
At the bottom of the page click settings -> search settings
And confirm that the following option is checked: "Open each selected result in a new browser window"
Give it a try, if it doesn't work, check the steps below:
To try to resolve it, follow the steps below:
step 1
With Microsoft Edge open press Alt+F;
Click "Settings" / "Reset Settings" / "Restore Settings to Default Values";
And confirm by clicking Reset;
Close the browser and open it again.
After this process, check if you are in agreement.
Step 2
Note: If when opening Microsoft Edge, a Welcome tab opens, it means that the browser has been reset. Make a backup of your bookmarks before performing this action.
Close Microsoft Edge.
Open the start menu and type PowerShell.
Right-click Run As Administrator.
Copy and paste the command below:
Get-AppXPackage -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "C:\Windows\SystemApps\*Edge*\AppXManifest.xml"}
$manifest = (Get-AppxPackage *Edge*).InstallLocation + '\AppxManifest.xml' ; Add-AppxPackage -DisableDevelopmentMode -Register $manifest
After the command execution is complete, try to open Microsoft Edge.
If the answer helped in any way, please mark it as an answer, if your question has not been solved, please post again.
I hope I helped, see you later!
I'm trying to have a new window opened from the extension popup, but the best I can get is a new tab.. js that would work fine on a normal html page window.open("https://website.com", "aaaaa", "width=500,height=500") just opens a new tab instead when ran from the extension popup is there some special way with chrome.tabs API or whatever..? I tried looking online but all the code I could find (even stuff specifically for manifest v3 or whatever) didn't do anything at all.