[英]Chrome extension content script not loading
我正在嘗試將內容腳本添加到我的 chrome 擴展中,但由於某種原因,內容腳本沒有被執行
內容腳本代碼:
console.log("In content script");
文件名為content.js
我的清單文件:
{
"name": "Getting Started Example",
"description": "Build an Extension!",
"version": "1.0",
"manifest_version": 3,
"background": {
"service_worker": "background.js"
},
"permissions": [
"storage",
"activeTab",
"scripting",
"tabs"
],
"action": {
"default_popup": "popup.html"
},
"content_scripts": [
{
"all_frames": true,
"matches": [
"<all_urls>"
],
"js": [
"content.js"
]
}
],
"options_page": "options.html"
}
我真的很抱歉內容腳本的答案出現在瀏覽器控制台而不是擴展程序的控制台中,直到現在我才檢查擴展程序控制台
一切正常。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.