1

I am trying to do a chrome extension.

What I am basically try to do is implement : document.designMode = ‘on’. I don’t want to always have to go to the console from the browser to do this. I have gone far with building the extension, but the problem is that once I click on it. The script I wrote is just affecting the popup.html file.

It is not affecting the particular site.

Andrei Konstantinov
  • 6,073
  • 4
  • 34
  • 55
bigpreshy
  • 31
  • 5
  • Possible duplicate of [How to access the webpage DOM rather than the extension page DOM?](https://stackoverflow.com/questions/4532236/how-to-access-the-webpage-dom-rather-than-the-extension-page-dom) – wOxxOm Jun 07 '19 at 07:27

1 Answers1

1
  • Create content.js file;
  • Inside content.js add JS code to run on site;
  • Include code to manifest.json:
"content_scripts": [
    {
      "matches": [
        // add site urls where you want to run your extension
      ],
      "all_frames": true,
      "js": [
        "content.js" // here's your js
      ]
    }
  ],
  "permissions" : [
    "declarativeContent"
  ],
Andrei Konstantinov
  • 6,073
  • 4
  • 34
  • 55