Follow us on Twitter
Follow us in Facebook
Office Dev Content
SharePoint Dev Content
Blogs for Office developers > Apps for Office and SharePoint blog
Apps for Office can run in different browsers, such as Internet Explorer 9 and 10, Firefox, Chrome, and Safari. However, different browsers support web standards differently. In this article, we use the Wikipedia app for Office as an example to show that the document.selection method is not supported in Chrome. In general, a feature supported by one browser is not necessarily supported by another, so ensuring cross-browser compatibility of apps for Office remains the developers’ responsibility. You need to test the apps thoroughly in different browsers.
Right now, the “Napa” Office 365 Development Tools can deploy apps for Office straight to Office Web App (OWA), but Visual Studio does not. In this section, we describe a workaround to publish and open a Visual Studio app with Excel 2013 Web App.
For this post, we will use the Wikipedia app for Office as a running example. The Wikipedia app for Office is an open-source project, and you can download the source code from the Wikipedia App for Office source (GitHub).
Here is the issue that we encountered when we developed the Wikipedia app for Office. This app supports the insertion of highlighted text. This function uses the pop-up insert button “+” when a block of text is highlighted.
In Excel 2013 Web App in Internet Explorer 10, the function works well as shown in Figure 3.
In Excel 2013 Web App in Chrome, however, we can’t show the insert button “+”.
The Wikipedia app implements the pop-up insert button with the mouseup event and the document.selection().createRange() method in jQuery.
In Excel Web App, the following error appears in the developer tool when the user selects text. The error message shows that the document.selection method isn’t defined. This is because document.selection is not supported in Chrome.
Fixing the problem is straightforward.
Before submitting an app to the Office Store, do sanity checks in various browsers. An app for Office running in an Office Web App must be fully functional within the following browsers:
For any cross-browser compatibility issue, the Cross-browser Test Results table on the Internet Explorer Testing Center is a good reference to find causes. Note that although the test results are for Internet Explorer 11 and 10, Internet Explorer 9 has similar results. And you can also refer to the HTML5 test site.