2
我正在尝试编写一个需要在加载任何页面之前注入JS的Chrome扩展。我无法让我的JS执行。在使用内容脚本加载每个页面之前运行JS的Chrome扩展
这就是我对我的表现:
{
"manifest_version": 2,
"name": "testOne",
"description": "This extension inject js",
"version": "1.0",
"permissions": ["<all_urls>"],
"content_scripts": [
{
"matches": ["http://*/*"],
"js": ["myscript.js"],
"run_at": "document_start"
}
]
}
而这就是我在我的JS现在:
alert('test');
console.log('you tried to log');
为什么我没有看到控制台事件的任何警报?