-
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.
Add dnr-domaintype-thirdparty-wecg-731
- Loading branch information
1 parent
1a94b7b
commit 017924d
Showing
3 changed files
with
34 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
WECG issue: | ||
https://github.com/w3c/webextensions/issues/731 |
18 changes: 18 additions & 0 deletions
18
issues/dnr-domaintype-thirdparty-wecg-731/sample-extension/background.js
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Listen for the extension being installed or updated | ||
chrome.runtime.onInstalled.addListener(() => { | ||
chrome.declarativeNetRequest.updateDynamicRules({ | ||
addRules: [{ | ||
id: 1, | ||
action: { | ||
type: 'block', | ||
}, | ||
condition: { | ||
domainType: 'thirdParty', | ||
urlFilter: 'iana.org', | ||
resourceTypes: ['main_frame', 'sub_frame'], | ||
}, | ||
}], | ||
}).then(() => { | ||
console.log("Rules added"); | ||
}); | ||
}); |
14 changes: 14 additions & 0 deletions
14
issues/dnr-domaintype-thirdparty-wecg-731/sample-extension/manifest.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"manifest_version": 3, | ||
"name": "DNR thirdParty domainType", | ||
"version": "1.0", | ||
"description": "Demo extension showcasing issues regarding thirdParty domainType in DNR.", | ||
"permissions": [ "declarativeNetRequest" ], | ||
"background": { | ||
"scripts": ["background.js"], | ||
"service_worker": "background.js" | ||
}, | ||
"host_permissions": [ | ||
"<all_urls>" | ||
] | ||
} |
017924d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See w3c/webextensions#731