Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static Ruleset for JavaScript declarativeNetRequest API #4382

Draft
wants to merge 37 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f38c582
Add top level properties
moritztim Jan 21, 2025
d7b99f7
Add top level description
moritztim Jan 21, 2025
9572c0e
Add maximum
moritztim Jan 21, 2025
0934961
Add domainType property
moritztim Jan 21, 2025
3991a89
Add domains definition
moritztim Jan 21, 2025
b86490b
Create canonical domain regex
moritztim Jan 22, 2025
8ffe2dd
Add domains related properties
moritztim Jan 22, 2025
e7e9a89
Add docs links
moritztim Jan 22, 2025
5d66227
Add missing property
moritztim Jan 22, 2025
6356bb4
generalize stringArray
moritztim Jan 22, 2025
bb05f21
Add missing sentence and link
moritztim Jan 22, 2025
7ae389f
Mark explicitly as deprecated
moritztim Jan 22, 2025
2b38065
fix typo
moritztim Jan 22, 2025
6124f1b
add more properties
moritztim Jan 22, 2025
68c6055
Define requestMethod
moritztim Jan 22, 2025
368a6dd
Add exclusive properties
moritztim Jan 22, 2025
760c744
Add remaining properties
moritztim Jan 22, 2025
f82cf2b
Specify HeaderInfo
moritztim Jan 22, 2025
71e0802
formatting
moritztim Jan 22, 2025
d540769
Add action
moritztim Jan 22, 2025
0b6228e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 22, 2025
2ab60aa
rename to fit convention
moritztim Jan 22, 2025
25a040c
bruh moment
moritztim Jan 22, 2025
078d282
add id
moritztim Jan 22, 2025
4f18bbd
add to catalog
moritztim Jan 22, 2025
eac4271
Add missing type declaration
moritztim Jan 22, 2025
3f8d6ac
define resourceType
moritztim Jan 22, 2025
3be0e24
add modifyHeaders
moritztim Jan 22, 2025
e3f480b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 22, 2025
803877a
implement limitations and restrictions
moritztim Jan 22, 2025
ffa559a
allow for overlap between string and const
moritztim Jan 22, 2025
121cd0e
Allow for other types
moritztim Jan 22, 2025
b67f78a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 22, 2025
2e4c175
fix casing
moritztim Jan 22, 2025
32fb20e
fix matching multiple schemas
moritztim Jan 22, 2025
2b7027d
fix matching multiple schemas here too
moritztim Jan 22, 2025
f2e823a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Create canonical domain regex
  • Loading branch information
moritztim committed Jan 22, 2025
commit b86490b9ff06099962e7704d902730e40d94cd98
2 changes: 2 additions & 0 deletions src/schemas/json/DeclarativeNetRequestRuleset.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"type": "array",
"items": {
"type": "string",
"pattern": "^(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)|(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z]{2,63}|((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4}|\\[(?:[0-9a-f]{0,4}:){2,7}[0-9a-f]{0,4}\\])$",
"$comment": "https://regexr.com/8b9gm",
"description": "Domains specified in initiatorDomains, excludedInitiatorDomains, requestDomains, or excludedRequestDomains should comply with the following:\n\nSub-domains such as \"a.example.com\" are allowed.\nThe entries must consist of only lowercase ASCII characters.\nUse Punycode encoding for internationalized domains.\nIPv4 addresses must be represented as 4 numbers separated by a dot.\nIPv6 addresses should be represented in their canonical form, wrapped in square brackets.\n\nTo programmatically generate the canonical domain for a URL, use the URL API and read its hostname property, i.e., new URL(url).hostname.\n\nhttps://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/declarativeNetRequest/RuleCondition#canonical_domain"
}
}
Expand Down