I am testing my add-in on different platforms
my add-in contains the following code to do runtime checks in my JavaScript code
if (Office.context.requirements.isSetSupported("WordApi", 1.1) { // Code }
my test shows that the above if statement receives a TRUE in Word Online, meaning Word Online fully supports office.js version 1.1 , which i don't believe is true.
my add-in also contains the following code
var searchResults = context.document.body.search('to*n', {matchWildCards: true});
this code works perfectly in Office 2016, but does not in Word Online, this code can only get me an error like this :{"name":"OfficeExtension.Error","code":"GeneralException","me ssage":"This browser does not support the requested API.","traceMessages":[],"debugInfo":{},"stack":"GeneralExcepti on: This browser does not support the requested API.\n at Anonymous function
I went to check Word online, and i found Word Online does not support WildCards search as Office 2016, so I guess maybe this is the reason why I got the above error message.
Is there a way to detemine wherther this code is running in Word 2016 or Word Online, so that I could let my code fail in Word Online
source code of my add-in can be found in my repository "text-effect-autocorrection"