0
我正在做一個簡單的擴展,我試圖在這些特定的網頁中包含一個內容腳本。但問題是他們沒有被納入網站。我使用Chrome的開發人員工具工具進行了檢查。 然後我將match_urls設置爲所有頁面,但仍不包含它們。Chrome擴展的內容腳本沒有被注入任何網頁
這裏的manifest.json的:
{
"manifest_version": 2,
"name": "TestExten",
"description": "Test description.",
"version": "1.0",
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*"],
"run_at": "document.end",
"js": ["content.js"]
}
],
"permissions": [
"tabs",
"http://*/", "https://*/",
"cookies"
],
}
和content.js:
alert("loaded");
chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
alert("received message");
});
什麼錯嗎?
您確定擴展程序正在安裝並啓用嗎? – Barmar
它是'document_end'(而不是'document.end') – Deliaz