Manifest.js:
{
"manifest_version": 2,
"name": "A browser action with a popup that changes the page color",
"description": "Change the current page color",
"version":"1.0",
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"background": {
"scripts": ["popup.js"]
},
"icons":{ "64":"icon.png"},
"content_scripts": [
{
"matches": ["http://www.mypage.com/*","https://www.mypage.com/*"],
"js": ["content.js"]
}
]
}
content.js:
{
chrome.runtime.sendMessage(document.querySelectorAll('a.icon downloadPdf clickAction'));
}
这里我想根据“www.mypage.com”中的父页面点击事件触发我的扩展程序。是否可以在不更改mypage.com的代码的情况下触发扩展名?