OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
670 stars 96 forks source link

Wrong browser used by Office365 #2359

Closed gergelyoroszi closed 6 months ago

gergelyoroszi commented 2 years ago

Message from office-js bot: We’re closing this issue because it has been inactive for a long time. We’re doing this to keep the issues list manageable and useful for everyone. If this issue is still relevant for you, please create a new issue. Thank you for your understanding and continued feedback.

As we recently discovered, Office 365 apps use the wrong browser on most of our machines, but not all of them. With the latest Windows 10 updates and Office 365 updates (current channel) installed, the Office apps use the legacy Edge-based WebView, but they used the WebView2 before. On fresh installation in a VM, I cannot reproduce the issue.

Your Environment

Expected behavior

Office 365 apps use WebView2, again.

Current behavior

Office 365 apps use legacy Edge-based WebView.

Steps to reproduce

We couldn't recognize anything as the trigger of the bad behavior. At some point, it's just gone wrong. Can it be an update?

Provide additional details

  1. Chromium based Edge is installed
  2. WebView2 is installed

Context

We had some issues earlier with the legacy WebView. WebView2 has solved those, so they occur again.

Useful logs

I cannot provide any.

SylvaD-MS commented 2 years ago

Thanks, Gergel for reporting the issue and providing some information above.

It looks like you don't know what is(are) the main difference(s) between your VM with the clean install (not reproing the issue) and the users ' computer(s) which are experiencing the issue. Could you check whether the users' computer(s) experiencing the issue are domain joined? Could you also provide the name of the Office Web Add-ins for each one of the Office Hosts (Excel, Word and Outlook) that you tried? In addition, could the users experiencing the issue provide the WebView version number? Could anyone experiencing the issue search for Win32WebView2 key in the registry and then add the following reg key (after verifying whether it might be set to 0 instead of 1)? [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\WEF\Win32WebView2] dword:00000001 or under [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\16.0\WEF\Win32WebView2] or (in case the machine is domain joined) [HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Office\16.0\WEF\Win32WebView2] or under [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Office\16.0\WEF\Win32WebView2]

Finally, here is some information regarding the reg key above and some steps to verify whether WebView2 is correctly installed. https://devblogs.microsoft.com/microsoft365dev/understanding-office-add-ins-runtime/ You might want to be sure that the users rebooted their machine in case they are just in a temporary bad state.

gergelyoroszi commented 2 years ago

Thanks for your response, @SylvaD-MS. In the meanwhile, I could fix the problem. We use a fixed version of WebView2. Replacing it with the latest version seems to solve our problem for now.

Old WebView2 version: 96.0.1054.34 Current WebView2 version: 97.0.1072.55

Even though, I'd like to know if it can occur again in the future and what could cause it so we can prevent or prepare for it. Could you help in that regard?

Futher information as requiered:

SylvaD-MS commented 2 years ago

@gergelyoroszi, thanks Gergely for providing the additional information. Did you check Event Viewer (search for crash under application) or turn on logging (https://docs.microsoft.com/en-us/office/troubleshoot/diagnostic-logs/how-to-enable-office-365-proplus-uls-logging) to see whether they were any issue. It looks like you were able to fix the issue by installing the latest version of WV2 (WebView2 bld # 97.0.1072.55 January 6th vs. # 96.0.1054.34 November 23rd https://docs.microsoft.com/en-us/deployedge/microsoft-edge-relnote-stable-channel). However, as far as I know there were no known issue which could have prevented Office Web Add-in to use WV2 for that particular version. In addition, the current channel used WV2 by default vs. the semi-annual channel required to have the reg key above that I provided. But, you mentioned that this didn't fix the issue. As you suggested, the issue might have been related to an unsuccessful deployment of WV2 (despite that it looks like it was successfully installed). Do you know whether the initial WV2 was installed manually vs. installed by Office on the failing configuration? In addition, there is an AutoUpdate policy for WebView2 and it should automatically upgrade unless a fixed version might have been installed instead of the WV2 Evergreen bootstrapper. Did you have to upgrade it manually? Can you run the following: edge://settings/help in MS Edge Browser? Finally, if something similar occurs in the future, turn on logging and from Outlook, under Help use the Get Diagnostics with as much information as possible explaining the issue for each Office hosts and providing some logs.

gergelyoroszi commented 2 years ago

@SylvaD-MS That's right! We didn't need anything special except to use the latest WV2. We use the fixed version and don't use the WV2 Evergreen bootstrapper.

It still looks OK. If it occurs again, I'll reach you with the logs.

Thanks for your help!

mikewalker74 commented 2 years ago

We have some customers who are using Outlook 2019 Volume License LTS release and as such crazily MS seem to make this force to use IE as the render engine, the issue we are having is trying to provide a friendly message from a React based solution and even at the Index.HTML page there seems to be some issues in JS running properly and wonder if there is a specific issue on Windows 11 and using the Win32WebView2 = 0 option which forces to old version of render engine Trident I presume? Is there a way to set the Render engine for some addins to use IExplore vs more modern solutions and may i say "Securer" versions of addins use Edge/Chromium edition on these editions.

SylvaD-MS commented 2 years ago

@mikewalker74, correct setting Win32WebView (MS Edge Legacy browser) to zero (instead of 1) will force IE\Trident rendering engine to be used for Web Add-in. In addition, on Win11, the IE browser can't be launched manually, and it might be disabled (https://docs.microsoft.com/en-us/troubleshoot/developer/browsers/installation/disable-internet-explorer-windows). But the IE\Trident rendering engine should work fine for Web Add-in in Office. However, some customers might have run into an issue because IE COM automation might have been disabled. This should have now been fixed. Finally, Office 2019 doesn't support a specific rendering engine per Web Add-in.