0

I have created a chrome plugin but it is running on all google sites except gmail, how do I make it run on gmail?

My manifest file:

{
  "manifest_version": 2,
  "name": "drc",
  "version": "0.1",
  "background": {
    "scripts": ["bg.js"]
  },
  "content_scripts": [
    {
      "matches": [
        "<all_urls>"
      ],
      "js": ["content.js", "onclic.js", "Jquery.js"],
      "css": ["drpdwn.css"]
    }
  ],
  "browser_action": {
    "default_title": "Append Test Text"
  },
  "permissions": [
    "tabs",
    "activeTab",
    "https://mail.google.com/*",
    "http://mail.google.com/* "
  ]
}

Error I get is, cannot read property 'parentNode' of null

  • 1
    There's probably something wrong in your manifest.json or relevant code. Add it to your question. – wOxxOm Apr 26 '18 at 09:39
  • I only needed to let the page load first[enter link description here](https://stackoverflow.com/questions/4498482/javascript-cant-find-element-by-id?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa) – Aviral Bansal Apr 26 '18 at 11:53
  • Well, gmail is a dynamic AJAX-driven page so you need to use MutationObserver or check the presence of the element periodically in setInterval callback. – wOxxOm Apr 26 '18 at 12:00

0 Answers0