Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebView2 controller is not created when launch application as different Admin user #3738

Closed
mdnchauhan opened this issue Aug 24, 2023 · 6 comments
Assignees
Labels
bug Something isn't working tracked We are tracking this work internally.

Comments

@mdnchauhan
Copy link

mdnchauhan commented Aug 24, 2023

The case is:-
Logged in to machine as a standard user (non admin) user_S
Run the application as a different user (admin) user_A

  • Application launched and running as user_A
  • But ICoreWebView2Controller is null during CreateCoreWebView2Controller.

Some more observation -
1- Login as user_S and Run the app : everything works fine and I can see app + msedgewebview2.exe both are running as user_S.
2- Login as user_A and Run the app : everything works fine and I can see app + msedgewebview2.exe both are running as user_A.
3- Login as user_S and Run the app as user_A : app is as user_A BUT msedgewebview2.exe is not running.

Note- I am providing webview2 userdata folder that is accessible and readable/writable to all users during CreateCoreWebView2EnvironmentWithOptions.

Version
working on Win10.
installed WebView2 version 115.0.1901.203
WebView2 component is installed at C:\Program Files (x86)\Microsoft\EdgeWebView\Application\115.0.1901.203

Is there any settings that I can change at the time of WebView2 initialization, or is it a limitation of WebView2?

AB#46240515

@mdnchauhan mdnchauhan added the bug Something isn't working label Aug 24, 2023
@novac42
Copy link
Contributor

novac42 commented Aug 25, 2023

Thanks for reporting the issue. I've assigned this to a dev who can help follow up on this.

@mdnchauhan
Copy link
Author

Thanks for the response.

I noticed one more point here, It works on version 113.0.1774.42.
Issue is reproducing on 116.0.1938.54 and 115.0.1901.203.
There is no such issue on 113.0.1774.42.

Thanks

@LiangTheDev LiangTheDev added the tracked We are tracking this work internally. label Aug 28, 2023
@LiangTheDev
Copy link
Member

I can repro the issue. Temporary workaround before we fix it: add additional browser switch --edge-webview-disable-mojo-ipcz. If you don't want to or could not modify the app code to add that when creating webview environment object, you can set that --edge-webview-disable-mojo-ipcz in a string registry value under HKLM\Software\Policies\Microsoft\Edge\WebView2\AdditionalBrowserArguments with the app's exe name as the name of the register value or set it in environment variable WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS for the admin user. If using environment variable, it will impact all apps using webview2, so less desirable.

@mdnchauhan
Copy link
Author

Thanks for this fix, as of now this fix is solving the purpose.
I tried by implementing browser switch --edge-webview-disable-mojo-ipcz while creating environment object in the code and that works. (we can not change the registry or env variable of user's machine)

Could you please give some idea on below-

  • What that switch actually does. Does it bypass some security?
  • Can it make any negative impact on other scenario, like - "logged in as Admin and run the app as Admin" OR "logged in as admin and run the app as System user"?
  • Do we need to remove this switch once we get the fixed release?

Thanks

@LiangTheDev
Copy link
Member

There is a recent change from Chromium on how inter-process communication is implemented. The switch makes Edge WebView using the old implementation instead of new implementation. It should not impact security or other scenarios. As the new implementation is more performant, and it is likely that the old implementation is going to be removed from the codebase some time in the far future, we should remove the switch once we get a fix. FWIW, we haven't figure out the details yet, and don't have an estimate on when the fix might be available.

@LiangTheDev
Copy link
Member

LiangTheDev commented Sep 6, 2023

A fixed has been made for the issue in Edge version >= 118.0.2084.0. You could test it out when it reaches Edge Dev channel (which is installed per machine), or wait for it to reach stable Edge WebView2 Runtime around week of 12-Oct-2023.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tracked We are tracking this work internally.
Projects
None yet
Development

No branches or pull requests

4 participants