I've got a third party script that runs in many places on the web. I'd like to be able to tell when I'm running in an app vs. a browser. The user agent doesn't always help. Chrome provides the chrome
object which has some different properties depending on the environment. Anyone know of anything similar for IE?
This is for a product similar to google analytics which can be implemented or wind up in many environments, and I'm trying to distinguish them better.
Check for window.external. If window.external is null then the web page is loaded into a Web Component, otherwise it is loaded via browser.
window.external enable you to communicate with [ComVisible(true)] instances which are enabled by default in the browsers. As long as your apps are not decorated with [ComVisible(true)], you can distinguish between app and browser page consumption.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With