Search code examples
office-jspolyfills

Web browser versions to target with Office.js


With Office.js, the Office Add-ins run in a version of Internet Explorer on Windows, WebKit on Mac/iOS, and whatever browser is supported by Office 365. I'm assuming that Internet Explorer is going to be the short end of the stick in terms of compatibility with modern Web APIs.

When developing an add-in with Office.js, what version of Internet Explorer should be a target and provide polyfills for missing features such as fetch and the like? Does Office.js provide a polyfill for Promise?

The dev.office.com documentation has no guidance that I can find on these pages:


Solution

  • For all practical purposes, you should be able to assume IE11. And use something like modernizr to validate the features you care about (or just do a blanket statement that if it's IE, it should be >= IE 11). In the 1% chance (or less?) that someone is using IE9/10, you could have a message prompting the user to upgrade his/her IE installation.

    Office.js (when targeting more recent versions of Excel/Word) does include a Promise polyfill under OfficeExtension.Promise (which if you wanted to, you could assign to window.Promise). But on the other hand, you may just want to use a real global Promise polyfill that you're more in control of (e.g., the Promise that comes with core.js).