forked from GoogleChrome/chrome-extensions-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added json for prettier, npm run prettier in lint-staged
- Loading branch information
1 parent
e09fc71
commit dc5d34f
Showing
14 changed files
with
101 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
[ | ||
{ | ||
"id" : 1, | ||
"id": 1, | ||
"priority": 1, | ||
"action" : { "type" : "block" }, | ||
"condition" : { | ||
"urlFilter" : "||example.com", | ||
"resourceTypes" : ["main_frame"] | ||
"action": { "type": "block" }, | ||
"condition": { | ||
"urlFilter": "||example.com", | ||
"resourceTypes": ["main_frame"] | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 20 additions & 10 deletions
30
api-samples/declarativeNetRequest/url-redirect/rules_1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
# chrome.printing | ||
|
||
This sample demonstrates all four methods of the `chrome.printing` namespace. | ||
This sample demonstrates all four methods of the `chrome.printing` namespace. | ||
|
||
## Overview | ||
|
||
The `chrome.printing` namespace only works on ChromeOS. The sample demonstrates how to get a list of available printers and display it to a user. A 'Print' button sends a sample PDF to the selected printer and makes a 'Cancel Printing' visible. This button is visible while the print job's status is `"PENDING"` or `"IN_PROGRESS"`. Note that on some systems, the print job is passed to the printer so quickly that you may never see the 'Cancel Printing' button. | ||
|
||
Calling `submitJob()` triggers a dialog box asking the user to confirm printing. Use the [`PrintingAPIExtensionsAllowlist`](https://chromeenterprise.google/policies/#PrintingAPIExtensionsAllowlist") policy to bypass confirmation. | ||
Calling `submitJob()` triggers a dialog box asking the user to confirm printing. Use the [`PrintingAPIExtensionsAllowlist`](https://chromeenterprise.google/policies/#PrintingAPIExtensionsAllowlist") policy to bypass confirmation. | ||
|
||
## Implementation Notes | ||
|
||
Note that the `submitJob()` function throws an error when returning a promise ([crbug: 1422837](https://bugs.chromium.org/p/chromium/issues/detail?id=1422837)). | ||
Note that the `submitJob()` function throws an error when returning a promise ([crbug: 1422837](https://bugs.chromium.org/p/chromium/issues/detail?id=1422837)). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
{ | ||
"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 | ||
} | ||
"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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,24 @@ | ||
[ | ||
{ | ||
"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": 1, | ||
"priority": 100, | ||
"action": { | ||
"type": "redirect", | ||
"redirect": { | ||
"url": "https://i.chzbgr.com/completestore/12/8/23/S__rxG9hIUK4sNuMdTIY9w2.jpg" | ||
} | ||
}, | ||
{ | ||
"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"]} | ||
} | ||
] | ||
"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"] } | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters