how can i make msedge in --app mode doesn't rember window size

samaliy li 66 Reputation points
2022-03-28T09:04:04.063+00:00

In my c# program,I use System.Process to open msedge.exe with in app mode.I used --window-size to control the msedge window's size.However,when i open an new site in the mainwindow by the window.open function,the childwindow is the same as the mainwindow's size. Even I set the size for the childwindow,it doesn't work.
Why the childwindow be the same with the maniwindow?

The detail like the follow:
1.In C# ,open msedge.exe in app mode
string arg = " --window-position=10,10 --window-size=300,300 " + "--app" + "=" + "http://XXXX/sample.jsp"
process.StartInfo.FileName = "C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe";
・・・
process.StartInfo.Arguments = arg;
process.Start();

2.In sample.jsp page,I excute the follow to open a new site.
window.open('" + XXXX+ "','" + windowName + "','toolbar=no,scrollbars=no,location=no,status=no,menubar=no,resizable=no,left=0,top=0,width=100,height=100')

3.The new childwindow is always same with the sample.jsp window's size.

Is there anyway to solve this problem? How can I contorl the childwindow's size that isn't be same to the mainwindow.

Best Regards

Microsoft Edge
Microsoft Edge
A Microsoft cross-platform web browser that provides privacy, learning, and accessibility tools.
2,181 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Yu Zhou-MSFT 12,461 Reputation points Microsoft Vendor
    2022-03-29T09:35:50.16+00:00

    Hi @samaliy li

    I can reproduce the issue. It looks like in app mode, if you add the --window-size argument, it will be applied to every window opened from it. I think that's by design in Edge browser.

    AFAIK, there's no workaround to change it unless you don't configure the --window-size argument when open Edge in app mode. I suggest that you can provide feedback about this to Edge team by pressing Alt+Shift+I in Edge. Edge team will check the feedbacks and improve the product continuously. Thanks for your understading.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Regards,
    Yu Zhou