chrome扩展:点击父页面,如下载按钮,触发chrome扩展/插件。有可能吗?

时间:2017-01-31 18:48:13

标签: google-chrome google-chrome-extension

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的代码的情况下触发扩展名?

0 个答案:

没有答案