-1

I have been recently trying to build a chrome extension and I have a piece of code that needs to declare a function on a webpage. I have been able to successfully inject code into the webpage via the console but how would I make my chrome extension run my code when something like a button is pressed?

Soupy
  • 160
  • 10

1 Answers1

0

You can find a good Explanation here : Google Developer Content Scripts

Short Guide:

  • Create a content-script
  • Add it to your manifest.
  • get the Body: const $body = $("body")
  • Insert your content: $body.append("Content");

Attention: In your manifest you need the tabs permission

Nadin Hermann
  • 34
  • 1
  • 5