0

I'm developing .NET Windows From application in C#. As per my requirement, I need to open a URL in the browser's Pop up (not the browser main window) same as it is opened using javascript's "window.open" method. This was a little tricky but I managed by using the below CMD command.

C:\Window\system32>start msedge --app="https://www.google.com/"

I parsed the above command into C# code to trigger a similar result. Process.Start("msedge", "--app=\"https://www.google.com\"");

The code works fine for Chrome only. But when it runs for Edge or Firefox it opens the browser (main browser window) with an empty address bar. Whereas I'm expecting this should open the URL in the mentioned browser popup window.

1 Answer 1

1

Which version of Edge are you using? I use code below and it works well. You can try it to see if it works on your machine:

Process process = new Process();
string arg = "--app" + "=" + "https://www.google.com";
process.StartInfo.FileName = "C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe";
process.StartInfo.Arguments = arg;
process.Start();
Sign up to request clarification or add additional context in comments.

2 Comments

Hi @YuZhou. Thanks for this. It works fine with an edge now. But still have problems when running this code for firefox. Any idea why it's not running for firefox only?
The reason why it doesn't work in Firefox is that it doesn't support App mode any more. You can refer to this link: support.mozilla.org/ln/questions/1363248.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.