Javascript Google.com和DOMContentLoaded

Javascript Google.com和DOMContentLoaded,javascript,google-chrome,google-chrome-extension,Javascript,Google Chrome,Google Chrome Extension,我在content_脚本中使用以下代码测试了我的google chrome扩展: function test() { alert("test"); } document.addEventListener("DOMContentLoaded", test, false); 舱单: { "name": "Test", "version": "1.0", "manifest_version": 2, "permissions": ["contextMenu

我在content_脚本中使用以下代码测试了我的google chrome扩展:

function test()
{
    alert("test");
}


document.addEventListener("DOMContentLoaded", test, false);
舱单:

{
    "name": "Test",
    "version": "1.0",
    "manifest_version": 2,
    "permissions": ["contextMenus", "tabs", "http://*/*", "https://*/*"],
    "content_scripts": [{
        "all_frames": true,
        "js": [ "jquery-1.8.1.min.js","test.js"],
        "matches": [ "http://*/*" ],
        "run_at": "document_start"
    }]
}
所有网页都可以,比如facebook或microsoft。。。。。页面加载后,会弹出一个alertbox,除了“Google.com”=>我访问了Google.com,但没有alertbox。我想知道为什么除了Google.com,几乎所有的页面都可以?那么,我需要在Google.com加载后捕获哪个DOM事件


谢谢

谷歌总是使用https,您的脚本不会被注入任何https网站,因为您只针对http网站(在您的清单中,您有:
“匹配项”:[“http://*/*”],


将清单更改为
“匹配项”:[“http://*/*”、“https://*/*”]、
“匹配项”:[“”]、

尝试将
“https://*/*”
添加到内容脚本匹配项中,我认为谷歌总是将您转发到一个安全的服务器。我记得看到一些信息,谷歌网站存储上(至少)禁用了所有扩展(出于安全原因)。谷歌也可能发生类似的事情。@Dan Lee:你说得对,谢谢