There is the function: Xrm.Internal.isUci(), but that is labelled as Internal, so its most likely not supposed to be used. But, I need a method to determine if my code is being invoked from the UCI or from the legacy web-client (because, there are behavior differences in how the code behaves).
Is there a supported mechanism to determine this?
This is what we are using today, which is supported & working for us:
function isUCI() {
var globalContext = Xrm.Utility.getGlobalContext();
var t1 = globalContext.getCurrentAppUrl();
var t2 = globalContext.getClientUrl();
return t1 !== t2;
}