By the end of this lesson Job Hunt Helper will mark your keywords on a job page with one click, using only permissions that show users no warning.
You need: Job Hunt Helper 0.1 from lesson 2, loaded in Chrome · Time: 8 minutes
A content script is JavaScript that runs inside a web page. It can read the page text and change it, for example wrap the word "fresher" in a yellow marker. There are two ways to put it on a page:
- Automatically, on sites you list in the manifest (for example every page on
www.naukri.com). Handy, but the extension asks for access to those sites all the time, and Chrome warns the user at install. - On click, with the
activeTabandscriptingpermissions. Nothing runs until you click a button in the popup, and then only on the tab you are looking at. activeTab gives the extension temporary access to the current tab after you click; scripting lets it put a script on that tab.
Job Hunt Helper uses way 2. You want highlights only when you ask for them, and it works on any job site without listing each one.
Why?Access that starts with your click is the safest kind: the extension sees nothing while you browse your bank or email. It also means no scary warning and an easier store review.
- Automatically, on sites you list in the manifest (for example every page on
Log in free to read the rest of this lesson
Every lesson is free. A free account unlocks all of them and saves your progress.
Still to come in this lesson:
- What Chrome tells users about each permission
- Add the Highlight button
- Manifest V3 rules your extension must follow
- Never ship an API key inside an extension
- Recap