Επεξεργασία

Κοινή χρήση μέσω


Browsers and webview controls used by Office Add-ins

Office Add-ins are web applications that are displayed using iframes when running in Office on the web. In Office for desktop and mobile clients, Office Add-ins use an embedded browser control (also known as a webview). Add-ins also need a JavaScript engine to run the JavaScript. Both the embedded browser and the engine are supplied by a browser installed on the user's computer. In this article, "webview" refers to the combination of a webview control and a JavaScript engine.

Which webview is used depends on:

  • The computer's operating system.
  • Whether the add-in is running in Office on the web, in Office downloaded from a Microsoft 365 subscription, or in perpetual Office 2016 or later.
  • Within the perpetual versions of Office on Windows, whether the add-in is running in the "retail" or "volume-licensed" variation.

Important

Webviews from Internet Explorer and Microsoft Edge Legacy are still used in Office Add-ins

Some combinations of platforms and Office versions, including volume-licensed perpetual versions through Office 2019, still use the webview controls that come with Internet Explorer 11 (called "Trident") and Microsoft Edge Legacy (called "EdgeHTML") to host add-ins, as explained in this article. Internet Explorer 11 was disabled in Windows 10 and Windows 11 in February 2023, and the UI for launching it was removed; but it's still installed on those operating systems. So, Trident and other functionality from Internet Explorer can still be called programmatically by Office.

We recommend (but don't require) that you continue to support these combinations, at least in a minimal way, by providing users of your add-in a graceful failure message when your add-in is launched in one of these webviews. Keep these additional points in mind:

  • Office on the web no longer opens in Internet Explorer or Microsoft Edge Legacy. Consequently, AppSource doesn't test add-ins in Office on these web browsers.
  • AppSource still tests for combinations of platform and Office desktop versions that use Trident or EdgeHTML. However, it only issues a warning when the add-in doesn't support these webviews; the add-in isn't rejected by AppSource.
  • The Script Lab tool no longer supports Trident.

For more information about supporting Trident or EdgeHTML, including configuring a graceful failure message on your add-in, see Support older Microsoft webviews and Office versions.

The following sections specify which browser is used for the various platforms and operating systems.

Non-Windows platforms

For these platforms, the platform alone determines the browser that's used.

OS Office version Browser
any Office on the web The browser in which Office is opened.
(But note that Office on the web will not open in Internet Explorer.
Attempting to do so opens Office on the web in Edge.)
Mac any Safari with WKWebView
iOS any Safari with WKWebView
Android any Chrome

Important

Conditional Access isn't supported for Office Add-ins on iOS or Android. Those add-ins use the Safari-based WKWebView or the Android-based WebView, not an Edge-based browser control.

Windows

An add-in running on Windows might use any of three different webviews:

  • WebView2, which is provided by Microsoft Edge (Chromium-based).
  • EdgeHTML, which is provided by Microsoft Edge Legacy.
  • Trident+, which is provided by Internet Explorer 11. The "+" on the end indicates that Office Add-ins use additional functionality from Internet Explorer 11 that isn't built into Trident itself.

Perpetual versions of Office on Windows

For perpetual versions of Office on Windows, the browser that's used is determined by the Office version, whether the license is retail or volume-licensed, and whether the Edge WebView2 (Chromium-based) is installed. The version of Windows doesn't matter, but note that Office Add-ins aren't supported on versions earlier than Windows 7 and Office 2021 and later aren't supported on versions earlier than Windows 10.

To determine whether Office 2016 or Office 2019 is retail or volume-licensed, use the format of the Office version and build number. (For Office 2021 and later, the distinction between volume-licensed and retail doesn't matter.)

  • Retail: For both Office 2016 and 2019, the format is YYMM (xxxxx.xxxxxx), ending with two blocks of five digits; for example, 2206 (Build 15330.20264).
  • Volume-licensed:
    • For Office 2016, the format is 16.0.xxxx.xxxxx, ending with two blocks of four digits; for example, 16.0.5197.1000.
    • For Office 2019, the format is 1808 (xxxxx.xxxxxx), ending with two blocks of five digits; for example, 1808 (Build 10388.20027). Note that the year and month is always 1808.
Office version Retail vs. Volume-licensed WebView2 installed? Browser
Office 2024 Doesn't matter Yes1 WebView2 (Microsoft Edge2 Chromium-based)
Office 2021 Doesn't matter Yes1 WebView2 (Microsoft Edge2 Chromium-based)
Office 2019 Retail Yes1 WebView2 (Microsoft Edge2 Chromium-based)
Office 2019 Retail No EdgeHTML (Microsoft Edge Legacy)2, 3
If Edge isn't installed, Trident+ (Internet Explorer 11) is used.
Office 2019 Volume-licensed Doesn't matter Trident+ (Internet Explorer 11)
Office 2016 Retail Yes1 WebView2 (Microsoft Edge2 Chromium-based)
Office 2016 Retail No EdgeHTML (Microsoft Edge Legacy)2, 3
If Edge isn't installed, Trident+ (Internet Explorer 11) is used.
Office 2016 Volume-licensed Doesn't matter Trident+ (Internet Explorer 11)

1 On Windows versions prior to Windows 11, the WebView2 control must be installed so that Office can embed it. It's installed with perpetual Office 2021 or later; but it isn't automatically installed with Microsoft Edge. If you have an earlier version of perpetual Office, use the instructions for installing the control at Microsoft Edge WebView2 / Embed web content ... with Microsoft Edge WebView2.

2 When you use either EdgeHTML or WebView2, the Windows Narrator (sometimes called a "screen reader") reads the <title> tag in the page that opens in the task pane. In Trident+, the Narrator reads the title bar of the task pane, which comes from the add-in name that's specified in the add-in's manifest.

3 If your add-in uses an add-in only manifest and includes the <Runtimes> element in the manifest or it uses the unified manifest and it includes an "extensions.runtimes.lifetime" property, then it won't use EdgeHTML. If the conditions for using WebView2 are met, then the add-in uses WebView2. Otherwise, it uses Trident+. For more information, see Runtimes and Configure your Outlook add-in for event-based activation.

Microsoft 365 subscription versions of Office on Windows

For subscription Office on Windows, the browser that's used is determined by the operating system, the Office version, and whether the WebView2 control is installed.

OS Office version WebView2 installed? Browser
  • Windows 11
  • Windows 10
  • Windows 8.1
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
Microsoft 365 ver. >= 16.0.13530.204241 Yes2 WebView2 (Microsoft Edge3 Chromium-based)
  • Window 11
  • Windows 10 ver. >= 1903
Microsoft 365 ver. >= 16.0.13530.204241 No EdgeHTML (Microsoft Edge Legacy)3, 4
  • Windows 11
  • Windows 10 ver. >= 1903
Microsoft 365 ver. >= 16.0.11629 AND < 16.0.13530.204241 Doesn't matter EdgeHTML (Microsoft Edge Legacy)3, 4
  • Windows 11
  • Windows 10 ver. >= 1903
Microsoft 365 ver. < 16.0.116291 Doesn't matter Trident+ (Internet Explorer 11)
  • Windows 10 ver. < 1903
  • Windows 8.1
Microsoft 365 No Trident+ (Internet Explorer 11)
  • Windows 7
Microsoft 365 Doesn't matter Trident+ (Internet Explorer 11)

1 See the update history page and how to find your Office client version and update channel for more details.

2 On Windows versions prior to Windows 11, the WebView2 control must be installed so that Office can embed it. It's installed with Microsoft 365, Version 2101 or later, but it isn't automatically installed with Microsoft Edge. If you have an earlier version of Microsoft 365, use the instructions for installing the control at Microsoft Edge WebView2 / Embed web content ... with Microsoft Edge WebView2. On Microsoft 365 builds before 16.0.14326.xxxxx, you must also create the registry key HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\WEF\Win32WebView2 and set its value to dword:00000001.

3 When you use either EdgeHTML or WebView2, the Windows Narrator (sometimes called a "screen reader") reads the <title> tag in the page that opens in the task pane. In Trident+, the Narrator reads the title bar of the task pane, which comes from the add-in name that's specified in the add-in's manifest.

4 If your add-in uses an add-in only manifest and includes the <Runtimes> element in the manifest or it uses the unified manifest and it includes an "extensions.runtimes.lifetime" property, then it won't use EdgeHTML. If the conditions for using WebView2 are met, then the add-in uses WebView2. Otherwise, it uses Trident+. For more information, see Runtimes and Configure your Outlook add-in for event-based activation.

Working with Trident+ (Internet Explorer 11)

Trident+ doesn't support JavaScript versions later than ES5. If any of your add-in's users have platforms that use Trident+, then to use the syntax and features of ECMAScript 2015 or later, you have two options.

  • Write your code in ECMAScript 2015 (also called ES6) or later JavaScript, or in TypeScript, and then compile your code to ES5 JavaScript using a compiler such as babel or tsc.
  • Write in ECMAScript 2015 or later JavaScript, but also load a polyfill library such as core-js that enables IE to run your code.

For more information about these options, see Support older Microsoft webviews and Office versions.

Also, Trident+ doesn't support some HTML5 features such as media, recording, and location. To learn more, see Determine the webview the add-in is running in at runtime.

Troubleshoot EdgeHTML and WebView2 (Microsoft Edge) issues

Service Workers aren't working

Office Add-ins don't support Service Workers when EdgeHTML is used. They're supported with WebView2.

Scroll bar doesn't appear in task pane

By default, scroll bars in EdgeHTML and WebView2 are hidden until hovered over. To ensure that the scroll bar is always visible, the CSS styling that applies to the <body> element of the pages in the task pane should include the -ms-overflow-style property and it should be set to scrollbar.

When debugging with the Microsoft Edge DevTools, the add-in crashes or reloads

Setting breakpoints in the Microsoft Edge DevTools for EdgeHTML can cause Office to think that the add-in is hung. It will automatically reload the add-in when this happens. To prevent this, add the following Registry key and value to the development computer: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\16.0\Wef]"AlertInterval"=dword:00000000.

When the add-in tries to open, get "ADD-IN ERROR We can't open this add-in from the localhost" error

One known cause is that EdgeHTML requires that localhost be given a loopback exemption on the development computer. Follow the instructions at Cannot open add-in from localhost.

Get errors trying to download a PDF file

Directly downloading blobs as PDF files in an add-in isn't supported with EdgeHTML or WebView2. The workaround is to create a simple web application that downloads blobs as PDF files. In your add-in, call the Office.context.ui.openBrowserWindow(url) method and pass the URL of the web application. This will open the web application in a browser window outside of Office.

WIP-protected documents

There's an extra step needed for Add-ins to run in a document with WIP (Windows Information Protection) and use WebView2 (Microsoft Edge Chromium-based). Add the WebView2 process, msedgewebview2.exe, to the protected apps list in your enterprise's WIP policy. An admin adds this WIP policy through Intune with the following values.

  • Name: Webview2
  • Publisher: O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US
  • Product Name: MICROSOFT EDGE WEBVIEW2
  • File: MSEDGEWEBVIEW2.EXE
  • Min Version: *
  • Max Version: *

If the WIP policy hasn't been added, the add-in defaults to an older runtime. In the sections Perpetual versions of Office on Windows and Microsoft 365 subscription versions of Office on Windows earlier in this article, substitute EdgeHTML (Microsoft Edge Legacy) for WebView2 (Microsoft Edge Chromium-based) wherever the latter appears.

To determine if a document is WIP-protected, follow these steps.

  1. Open the file.
  2. Select the File tab on the ribbon.
  3. Select Info.
  4. In the upper section of the Info page, just below the file name, a WIP-enabled document will have a briefcase icon followed by Managed by Work (...).

Note

Support for WebView2 in WIP-enabled documents was added with build 16.0.16626.20132. If you're on an older build, your runtime defaults to EdgeHTML (Microsoft Edge Legacy), regardless of policy.

See also