-1

I am new to chrome extensions so any help/advice is welcome. I would like to create an autofill chrome extension that fills in a form, only when on a certain page. How would I go about doing this? Thanks in advance.

user3376905
  • 177
  • 1
  • 3
  • 11

2 Answers2

3

Use a content script. This stuff is covered right at the beginning of the official docs.

Zig Mandel
  • 19,571
  • 5
  • 26
  • 36
2

In the manifest.json file, add a.js as a content script along with matches (the URLs on which this content script has to be loaded to be run in the context of the page) as follows :

"content_scripts": [
  {
    "matches": [
      "http://www.example.com/*",
      "http://www.example.com/pqr"
    "js": [
      "a.js"
    ]
  }
]
Xan
  • 74,770
  • 16
  • 179
  • 206
PG1
  • 1,220
  • 2
  • 12
  • 27