Understanding the Office Add-ins runtime

Office Add-ins require a runtime environment to execute. Think of a runtime as the execution environment for the add-in that’s a combination of a JavaScript engine and an HTML rendering control. A runtime can be encapsulated in a browser iFrame or an embeddable webview control on desktop clients. Since Office is a cross-platform suite, it uses different browsers, or webview controls, to run add-ins depending on the platform on which it is running. For more information about which browser or control is used by the various platforms, see Browsers used by Office Add-ins. 

Keep reading this blog post if:

  • You’ve ever wondered why Office Add-ins need to support Internet Explorer even though Microsoft does not
  • You didn’t know that add-ins can run in eight different runtimes across various platforms
  • You’re curious to learn how we are making this simpler (at least on Windows)

In this post, we describe the latest changes in Office’s use of web runtimes as well as summarize the runtimes that we’ve used on various platforms in the past. 

Note: Office uses a JavaScript runtime for UI-less add-ins, such as custom functions in Excel and autorun add-ins in Outlook. This is covered in Use the shared JavaScript runtime to improve the UI experience of your Office Add-in.

On Windows desktop, the future is WebView2 

Microsoft released the WebView2 browser control in October 2020. WebView2 is based on the open source Chromium project that popular browsers such as Google Chrome and the new Microsoft Edge use. WebView2 is the most modern web control available and is supported across Windows 8.1 and Windows 10. In addition, WebView2 is “evergreen”, meaning it is kept up-to-date with regular updates and security patches without relying on the operating system to be updated. To learn more about WebView2, see Introduction to Edge WebView2. 

Note: Windows 8.0 is no longer supported. Windows 8.1 support window ends in January 2023.

Office released support for WebView2 starting with Office version 16.0.13530.20424. This means if you have Office version 16.0.13530.20424 or later, and have the WebView2 runtime installed, Office will use WebView2 as the runtime for add-ins. This is an incredibly exciting step for the Office Platform not only because of all the benefits of WebView2, but also because it provides for uniformity of the runtime for add-ins across various versions of Windows. 

The WebView2 control is not automatically installed with Edge or Windows, yet. We expect that it will be available soon. In the meantime, there are two other ways to get WebView2 on the Windows computer:  

  1. Shortly after Office version 16.0.13530.20424 or later is installed on a computer (usually within 24 hours), WebView2 is automatically installed, if it isn’t already. (Administrators can disable this feature.)
  2. Users can download WebView2 from the Webview2 page.

Note: Customers on the Semi-Annual Enterprise channel of Office can expect to receive version Version 2102 in July 2021. Admins at these customers will need to take an additional step to enable the use of WebView2. They must create the registry key HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\WEF\Win32WebView2 and set its value to dword:00000001.

If the WebView2 control is not installed (or the registry change is not made where needed), then add-ins in subscription desktop Office will run in either the older webview control called EdgeHTML or just “WebView” (also known as “Spartan”), or the “Trident” webview control that originated with Internet Explorer 11. For details, see Browsers used by Office Add-ins.

To check if you have WebView2 installed on a computer, go to Settings > Add or remove programs and then search for WebView2 in the search box. You should see something similar to the following screenshot. 

Shows the listing for Microsoft Edge WebView2 Runtime in the list of installed programs in Windows 10.

Other runtimes used for add-ins on Windows 

Depending on the version of Office and Windows you have, add-ins may be running in older webview controls on your machine.  

  • EdgeHTML or legacy Edge control, was shipped as part of Windows 10 (1903 and later) and at the time of writing this blog post it is the most widely used runtime for Office add-ins on Windows.  
  • Trident (Internet Explorer 11 based web control) is used by the Office Add-ins as the runtime on older Windows 8.1 and Windows 10 machines, depending on the version of Office that is installed. For details, see Browsers used by Office Add-ins.

For detailed information on Office versions and web browser controls used, please see Browsers used by Office Add-ins. 

Discover what runtime you currently use for add-ins on Windows

There are several ways:

1. The easiest way is to click the Personality Menu of your add-in on Windows, and then select Security Info. The Personality Menu is launched when you click within the add-in (that is, your add-in task pane) and then click the “<” overlay, as shown in the upper right corner of the following screenshot.

Screenshot showing the task pane of an add-in with the personality menu overlay in the upper right corner of the task pane.

On machines that use WebView2 as the runtime, the Security Info dialog looks like the following. Note that the Runtime property is set to “Microsoft Edge”.  

Screenshot of the security info dialog that appears when Security Info is selected from the personality menu. The dialog shows that the runtime property is set to "Microsoft Edge".

2. Right-click within the add-in task pane and click Inspect. If this launches the new Microsoft Edge Developer tools, your add-in is using WebView2 as the runtime. 

3. Look in Task Manager for the process Microsoft Edge WebView2 after you launch an add-in. If it’s listed, then Office is using WebView2 as the runtime. 

To reach the widest possible audience, developers should ensure that their add-in functions on all the runtimes where add-ins are supported. We’ll write a separate blog post on developer experience, debugging, and validating your add-in on the various web runtimes on Windows.  

Other platforms 

macOS 

On macOS, Office currently uses WebKit2 as the runtime for add-ins. WebKit2 is shipped as part of the OS and is the engine behind Apple’s Safari web browser. WebKit2 is considered a modern browser by the platform and the industry at large, and in general developers shouldn’t see notable differences between WebView2 and WebKit2 with respect to support of HTML 5, CSS, and JavaScript standards. More detailed differences can be researched at the Can I use website.

Note: WebKit2 does not support “windowless hosting” whereas as WebView2 does support this starting with version 90. From an end user experience standpoint, this means that on macOS any Office content add-in turns into an image upon any user action, such as pan, zoom, scroll, etc., on the canvas.  

Office on the web 

When the customer is working in Office on the web, add-ins run in an iFrame of the same browser. We recommend using a modern browser such as Microsoft Edge, Google Chrome, Mozilla Firefox or Apple Safari to access Office for the web. For our list of officially supported browsers see Which browsers work with Office for the web.

Tell us what you think

We’d love your comments or suggestions for future improvement. Just create an issue on the Office-js repo on GitHub.

0 comments

Comments are closed. Login to edit/delete your existing comments