To have a Chrome extension show up automatically upon visiting a specific website, you can use the content script feature of Chrome extensions.
Open your extension's manifest.json file.
Add the "content_scripts" field and configure it to match the URL of the website where you want your extension to show up.
Example:
"content_scripts": [
{
"matches": ["https://www.website.com/*"],
"js": ["content_script.js"]
}
]
Here, the "matches" field specifies the URL pattern to match and the "js" field specifies the name of the JavaScript file that contains your content script.
Example:
if (window.location.href.includes("https://www.website.com/")) {
// extension logic here
}
Asked: 2021-09-22 11:00:00 +0000
Seen: 10 times
Last updated: Aug 05 '21