I am using a small function (first answer), that detects the browser. My setup is an apache server which is started with MAMP (Mac) on my local machine. The script is in a javascript file, which is loaded thru the header in html. But even if you test it in the chrome console, you have the same result.
Everything works well, when I use Chrome and localhost as address. (e.g. http://localhost:8888/index.html)
But as soon as I use my local ip address instead of localhost (e.g. http://192.168.0.1:8888/index.html), following javascript code returns false instead of true in Chrome:
!!window.chrome.runtime //it is undefined
And I have absolutely no idea, why this is so or how I can figure out the issue.
JS-Function | localhost:8888 | 192.168.0.1:8888
---------------------------------------------------------------
window.chrome.runtime | function | undefined
Why using local ip address? Because I want to show my colleagues sometimes something without deploying it.
localhost
. I don't think this is what is causing this issue, but its something to investigate as a possibility, at least. – Ere