Update api sample for action (#838)

* add sample for catifier that replaces every jpg image on web by another cat image

* add readme for catifier

* add section for set/get  badge text color

* add usage of isEnabled,getBadgeTextColor and setBadgeTextColor

* capitalize  button text

* use single quote and update badge text to test

* use <all_urls> host_permission
This commit is contained in:
Abhilekh Gautam
2023-03-09 21:53:28 +05:45
committed by GitHub
parent 45d8850c1a
commit 3091fb8d39
5 changed files with 131 additions and 7 deletions

View File

@@ -0,0 +1,8 @@
# Catifier
When the extension is enabled, it replaces every image of extension jpg or jpeg, with [this](https://i.chzbgr.com/completestore/12/8/23/S__rxG9hIUK4sNuMdTIY9w2.jpg) image.
## Testing the extension
1. Follow the instructions to load an [unpacked extension](https://developer.chrome.com/docs/extensions/mv3/getstarted/development-basics/#load-unpacked).
2. Navigate to any website, you should see every jpg or jpeg image being replaced by an image of a cat.

View File

@@ -0,0 +1,16 @@
{
"name": "Catifier",
"version": "1.0",
"description": "Replace every image by a cat's image in a website you visit",
"permissions": ["declarativeNetRequest"],
"host_permissions": ["<all_urls>"],
"declarative_net_request": {
"rule_resources": [{
"id": "ruleset_1",
"enabled": true,
"path": "rules.json"
}]
},
"manifest_version": 3
}

View File

@@ -0,0 +1,14 @@
[
{
"id": 1,
"priority": 100,
"action": { "type": "redirect", "redirect": { "url": "https://i.chzbgr.com/completestore/12/8/23/S__rxG9hIUK4sNuMdTIY9w2.jpg" } },
"condition": {"urlFilter": "*.jpeg", "resourceType": ["image"]}
},
{
"id": 2,
"priority": 100,
"action": { "type": "redirect", "redirect": { "url": "https://i.chzbgr.com/completestore/12/8/23/S__rxG9hIUK4sNuMdTIY9w2.jpg" } },
"condition": {"urlFilter": "*.jpg", "resourceType": ["image"]}
}
]