Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Limit Chrome Extension to certain URLs?

Tags:

Is there a way to limit a Chrome extension to only run on certain urls?

Say I want the extension to run only if the domain is Amazon.com. I realize you can put a check at the top of the scripts, then execute the rest of the script only if the check matches.

However, can you prevent the extension from running at all?

like image 816
amp343 Avatar asked May 08 '12 18:05

amp343


People also ask

How do I limit Chrome extensions?

To use Limit, simply enter the websites you find distracting and choose a daily time limit. For example, you could limit yourself to ten minutes a day on Facebook, or half an hour a day on Duolingo. When you approach your limit, Limit gently notifies you your time is almost up, so you can wrap up.

How do I remove an extension from a specific website?

Step 1: On the computer, open Google Chrome. Step 2: On the top right, click 'more tools', and choose then 'extensions'. Step 3: On to the extension one wants to remove, click 'remove'.

What is URL safety extension?

Google launched today a new Chrome extension that will simplify the process of reporting a malicious site to the Google Safe Browsing team so that it can be analyzed, reviewed, and blacklisted in Chrome and other browsers that support the Safe Browsing API.


1 Answers

Welp, it figures I would find the answer to this right after posting the question, even though I have been stuck for a while...

Archive of version of docs originally linked in answer: http://code.google.com/chrome/extensions/content_scripts.html

Analog page for Manifest V2 (though see also V3): https://developer.chrome.com/docs/extensions/mv2/content_scripts/

In manifest.json:

  "content_scripts": [     {       "matches": ["http://*.nytimes.com/*"],       "exclude_matches": ["*://*/*business*"],       "js": ["contentScript.js"]     }   ], 
like image 78
amp343 Avatar answered Nov 10 '22 15:11

amp343