I tried to get the domain name using alert(document.domain); But i’m not getting the right domain when I have the app installed on my chrome extension tool bar and test it out in a site,
I keep getting “hiecjmnbal…(long value)” which I believe represents my google app’s id.
I have added this in the manifest too
"content_scripts": [
{
"js": ["inject.js"]
}
],
alert(document.domain); is the only line of text inside inject.js.
I’ve also used window.top.location which shows the chrome extension url of: chrome-extension://hiecjmnbal...(long value)/popup.html
And I’ve incorporated this <script type="text/javascript" src="inject.js"> </script> into the main html file after popup.js
Any thoughts on why I’m not getting the correct domain url and only getting google chrome’s extension URL?
Thanks!
Have you tried: