I'm developing a chrome extension that will do something if it detects a specific object on the window object. For example in content.js I have
var el = document.getElementsByTagName("html");
console.log(el[0].ownerDocument.defaultView.someObj);
This logs undefined. If I run the same code within the browser console. I will see that someObj
exist. I get the correct element with
var el = document.getElementsByTagName("html");
but it doesn't seem like I can get the correct window object. Any ideas?
my manifest looks like
{
"manifest_version": 2,
"name": "My Ext",
"version": "0.1",
"content_scripts": [
{
"matches": [
"<all_urls>"
],
"js": ["content.js"]
}
],
"browser_action": {
"default_icon": "images/logo.svg"
}
}