Limit Chrome Extension to certain URLs?
up vote
14
down vote
favorite
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?
google-chrome google-chrome-extension
add a comment |
up vote
14
down vote
favorite
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?
google-chrome google-chrome-extension
add a comment |
up vote
14
down vote
favorite
up vote
14
down vote
favorite
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?
google-chrome google-chrome-extension
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?
google-chrome google-chrome-extension
google-chrome google-chrome-extension
asked May 8 '12 at 18:23
amp343
611410
611410
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
up vote
14
down vote
Welp, it figures I would find the answer to this right after posting the question, even though I have been stuck for a while...
http://code.google.com/chrome/extensions/content_scripts.html
In manifest.json:
"content_scripts": [
{
"matches": [...urls...],
"exclude_matches": [...urls...],
"css": [...]
}
]
4
FYI This doesn't prevent the script from running, it prevents chrome from injecting it into pages that don't match.
– Jim Schubert
May 8 '12 at 18:44
1
True, I guess that was the nature of my original question, should have worded it more carefully, Thanks.
– amp343
May 8 '12 at 18:58
add a comment |
up vote
3
down vote
There's a Chrome extension for this: Extension Automation. I had gone the route of modifying manifests before, but this is easier.
It's 404 Not Found.
– Balasubramani M
Oct 28 at 5:17
add a comment |
up vote
0
down vote
As a user, with Chrome 71 (or maybe even before) with chrome://flags/#extension-active-script-permission (you may need to enable User consent for extension scripts flag) allows you to right click extension icons and select "This can read and change site data" then you can choose:
- When you click the extension
- On current-domain-name.com
- On all sites (default)
This way you can limit an extension to only run on certain domains very quickly.
Limit as a user, or as a developer?
– Xan
Nov 15 at 11:27
@Xan You're right the question isn't very clear either, so I added "as a user".
– Wernight
Nov 19 at 13:56
I believe that from the context: 1) It's a question on StackOverflow (and not, say, Super User), 2) The original author self-responded with "how to do it through an extension manifest", the intent here is a developer question. Which makes it important to at least note that developers have no control over this mechanism. Though it's not fully off-topic as developers need to be aware of this, and may need to inform the users of this.
– Xan
Nov 19 at 14:02
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
14
down vote
Welp, it figures I would find the answer to this right after posting the question, even though I have been stuck for a while...
http://code.google.com/chrome/extensions/content_scripts.html
In manifest.json:
"content_scripts": [
{
"matches": [...urls...],
"exclude_matches": [...urls...],
"css": [...]
}
]
4
FYI This doesn't prevent the script from running, it prevents chrome from injecting it into pages that don't match.
– Jim Schubert
May 8 '12 at 18:44
1
True, I guess that was the nature of my original question, should have worded it more carefully, Thanks.
– amp343
May 8 '12 at 18:58
add a comment |
up vote
14
down vote
Welp, it figures I would find the answer to this right after posting the question, even though I have been stuck for a while...
http://code.google.com/chrome/extensions/content_scripts.html
In manifest.json:
"content_scripts": [
{
"matches": [...urls...],
"exclude_matches": [...urls...],
"css": [...]
}
]
4
FYI This doesn't prevent the script from running, it prevents chrome from injecting it into pages that don't match.
– Jim Schubert
May 8 '12 at 18:44
1
True, I guess that was the nature of my original question, should have worded it more carefully, Thanks.
– amp343
May 8 '12 at 18:58
add a comment |
up vote
14
down vote
up vote
14
down vote
Welp, it figures I would find the answer to this right after posting the question, even though I have been stuck for a while...
http://code.google.com/chrome/extensions/content_scripts.html
In manifest.json:
"content_scripts": [
{
"matches": [...urls...],
"exclude_matches": [...urls...],
"css": [...]
}
]
Welp, it figures I would find the answer to this right after posting the question, even though I have been stuck for a while...
http://code.google.com/chrome/extensions/content_scripts.html
In manifest.json:
"content_scripts": [
{
"matches": [...urls...],
"exclude_matches": [...urls...],
"css": [...]
}
]
edited May 9 '16 at 10:31
Skarlinski
1,627521
1,627521
answered May 8 '12 at 18:38
amp343
611410
611410
4
FYI This doesn't prevent the script from running, it prevents chrome from injecting it into pages that don't match.
– Jim Schubert
May 8 '12 at 18:44
1
True, I guess that was the nature of my original question, should have worded it more carefully, Thanks.
– amp343
May 8 '12 at 18:58
add a comment |
4
FYI This doesn't prevent the script from running, it prevents chrome from injecting it into pages that don't match.
– Jim Schubert
May 8 '12 at 18:44
1
True, I guess that was the nature of my original question, should have worded it more carefully, Thanks.
– amp343
May 8 '12 at 18:58
4
4
FYI This doesn't prevent the script from running, it prevents chrome from injecting it into pages that don't match.
– Jim Schubert
May 8 '12 at 18:44
FYI This doesn't prevent the script from running, it prevents chrome from injecting it into pages that don't match.
– Jim Schubert
May 8 '12 at 18:44
1
1
True, I guess that was the nature of my original question, should have worded it more carefully, Thanks.
– amp343
May 8 '12 at 18:58
True, I guess that was the nature of my original question, should have worded it more carefully, Thanks.
– amp343
May 8 '12 at 18:58
add a comment |
up vote
3
down vote
There's a Chrome extension for this: Extension Automation. I had gone the route of modifying manifests before, but this is easier.
It's 404 Not Found.
– Balasubramani M
Oct 28 at 5:17
add a comment |
up vote
3
down vote
There's a Chrome extension for this: Extension Automation. I had gone the route of modifying manifests before, but this is easier.
It's 404 Not Found.
– Balasubramani M
Oct 28 at 5:17
add a comment |
up vote
3
down vote
up vote
3
down vote
There's a Chrome extension for this: Extension Automation. I had gone the route of modifying manifests before, but this is easier.
There's a Chrome extension for this: Extension Automation. I had gone the route of modifying manifests before, but this is easier.
answered Jul 7 '16 at 16:16
Joe Fusion
414
414
It's 404 Not Found.
– Balasubramani M
Oct 28 at 5:17
add a comment |
It's 404 Not Found.
– Balasubramani M
Oct 28 at 5:17
It's 404 Not Found.
– Balasubramani M
Oct 28 at 5:17
It's 404 Not Found.
– Balasubramani M
Oct 28 at 5:17
add a comment |
up vote
0
down vote
As a user, with Chrome 71 (or maybe even before) with chrome://flags/#extension-active-script-permission (you may need to enable User consent for extension scripts flag) allows you to right click extension icons and select "This can read and change site data" then you can choose:
- When you click the extension
- On current-domain-name.com
- On all sites (default)
This way you can limit an extension to only run on certain domains very quickly.
Limit as a user, or as a developer?
– Xan
Nov 15 at 11:27
@Xan You're right the question isn't very clear either, so I added "as a user".
– Wernight
Nov 19 at 13:56
I believe that from the context: 1) It's a question on StackOverflow (and not, say, Super User), 2) The original author self-responded with "how to do it through an extension manifest", the intent here is a developer question. Which makes it important to at least note that developers have no control over this mechanism. Though it's not fully off-topic as developers need to be aware of this, and may need to inform the users of this.
– Xan
Nov 19 at 14:02
add a comment |
up vote
0
down vote
As a user, with Chrome 71 (or maybe even before) with chrome://flags/#extension-active-script-permission (you may need to enable User consent for extension scripts flag) allows you to right click extension icons and select "This can read and change site data" then you can choose:
- When you click the extension
- On current-domain-name.com
- On all sites (default)
This way you can limit an extension to only run on certain domains very quickly.
Limit as a user, or as a developer?
– Xan
Nov 15 at 11:27
@Xan You're right the question isn't very clear either, so I added "as a user".
– Wernight
Nov 19 at 13:56
I believe that from the context: 1) It's a question on StackOverflow (and not, say, Super User), 2) The original author self-responded with "how to do it through an extension manifest", the intent here is a developer question. Which makes it important to at least note that developers have no control over this mechanism. Though it's not fully off-topic as developers need to be aware of this, and may need to inform the users of this.
– Xan
Nov 19 at 14:02
add a comment |
up vote
0
down vote
up vote
0
down vote
As a user, with Chrome 71 (or maybe even before) with chrome://flags/#extension-active-script-permission (you may need to enable User consent for extension scripts flag) allows you to right click extension icons and select "This can read and change site data" then you can choose:
- When you click the extension
- On current-domain-name.com
- On all sites (default)
This way you can limit an extension to only run on certain domains very quickly.
As a user, with Chrome 71 (or maybe even before) with chrome://flags/#extension-active-script-permission (you may need to enable User consent for extension scripts flag) allows you to right click extension icons and select "This can read and change site data" then you can choose:
- When you click the extension
- On current-domain-name.com
- On all sites (default)
This way you can limit an extension to only run on certain domains very quickly.
edited Nov 19 at 13:54
answered Nov 15 at 8:47
Wernight
21.3k1696116
21.3k1696116
Limit as a user, or as a developer?
– Xan
Nov 15 at 11:27
@Xan You're right the question isn't very clear either, so I added "as a user".
– Wernight
Nov 19 at 13:56
I believe that from the context: 1) It's a question on StackOverflow (and not, say, Super User), 2) The original author self-responded with "how to do it through an extension manifest", the intent here is a developer question. Which makes it important to at least note that developers have no control over this mechanism. Though it's not fully off-topic as developers need to be aware of this, and may need to inform the users of this.
– Xan
Nov 19 at 14:02
add a comment |
Limit as a user, or as a developer?
– Xan
Nov 15 at 11:27
@Xan You're right the question isn't very clear either, so I added "as a user".
– Wernight
Nov 19 at 13:56
I believe that from the context: 1) It's a question on StackOverflow (and not, say, Super User), 2) The original author self-responded with "how to do it through an extension manifest", the intent here is a developer question. Which makes it important to at least note that developers have no control over this mechanism. Though it's not fully off-topic as developers need to be aware of this, and may need to inform the users of this.
– Xan
Nov 19 at 14:02
Limit as a user, or as a developer?
– Xan
Nov 15 at 11:27
Limit as a user, or as a developer?
– Xan
Nov 15 at 11:27
@Xan You're right the question isn't very clear either, so I added "as a user".
– Wernight
Nov 19 at 13:56
@Xan You're right the question isn't very clear either, so I added "as a user".
– Wernight
Nov 19 at 13:56
I believe that from the context: 1) It's a question on StackOverflow (and not, say, Super User), 2) The original author self-responded with "how to do it through an extension manifest", the intent here is a developer question. Which makes it important to at least note that developers have no control over this mechanism. Though it's not fully off-topic as developers need to be aware of this, and may need to inform the users of this.
– Xan
Nov 19 at 14:02
I believe that from the context: 1) It's a question on StackOverflow (and not, say, Super User), 2) The original author self-responded with "how to do it through an extension manifest", the intent here is a developer question. Which makes it important to at least note that developers have no control over this mechanism. Though it's not fully off-topic as developers need to be aware of this, and may need to inform the users of this.
– Xan
Nov 19 at 14:02
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f10504239%2flimit-chrome-extension-to-certain-urls%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown