I'm writing an application (using C#) which needs to open provided URL in a NEW window of a specified web browser. The only browser I have problems with is Microsoft Edge.
Opening a page using browser exe doesn't work at all. Browser window does not even appear.
Process.Start("C:\Windows\SystemApps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\MicrosoftEdge.exe", "https://google.com");
I've searched over the internet and found another way:
Process.Start("microsoft-edge:https://google.com");
This code opens the page, but attaches it to an existing window, if any.
Is there a way to open the page in a NEW window?
I am joining the line of desperate users of this program.
Here are my findings from today searching of such simple job (for normal browser).
@echo
EdgeLaunch.exe "http://www.idnes.cz"
EdgeLaunch.exe "http://www.seznam.cz"
exit
Sources: EdgeLaunch: http://www.edgemanage.emmet-gray.com/Articles/EdgeLaunch.html EdgeLauncher: https://github.com/MicrosoftEdge/edge-launcher
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Bypass -Force;
Start-Process -FilePath "msedge" -ArgumentList "http://idnes.cz"
Start-Process -FilePath "msedge" -ArgumentList "http://novinky.cz"
FUN FACT: if you leave the URLs blank, it will open new-windows. Once you add valid url...again in tabs.
But, ok classic HTML structure, and a script on the page with:
params = 'width='+screen.width;
params += ', height='+screen.height;
params += ', top=0, left=0'
params += ', fullscreen=yes';
params += ', directories=yes';
params += ', location=yes';
params += ', menubar=yes';
params += ', resizable=yes';
params += ', scrollbars=yes';
params += ', status=no';
params += ', toolbar=yes';
params += ', show=yes';
window.open("http://idnes.cz",'window1', params);
window.open("http://novinky.cz",'window2', params);
Desperate fact: It opens the windows on a second manual attempt. But. Once you set "status=yes" attribute. It will again be the TAB.
Thats all I got from internet. Nobody with solution of simply opening 2 damned windows with some webpages.
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.