Skip to content

Commit

Permalink
use adguard_ext_chromium_mv3 for ext_chromium_mv3 in platforms co…
Browse files Browse the repository at this point in the history
…nfig. AG-34320

Squashed commit of the following:

commit c8ee6ad
Author: Slava Leleka <[email protected]>
Date:   Fri Jul 12 13:33:19 2024 +0300

    update changelog

commit 91bede8
Author: Slava Leleka <[email protected]>
Date:   Fri Jul 12 13:31:57 2024 +0300

    update deps

commit df0a7c1
Author: Slava Leleka <[email protected]>
Date:   Fri Jul 12 01:24:12 2024 +0300

    update changelog

commit e67fb0b
Author: Slava Leleka <[email protected]>
Date:   Fri Jul 12 01:24:01 2024 +0300

    update tests

commit 68b014d
Author: Slava Leleka <[email protected]>
Date:   Fri Jul 12 01:23:44 2024 +0300

    update platforms config
  • Loading branch information
slavaleleka committed Jul 12, 2024
1 parent a68112b commit 0aaf332
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 18 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [v1.1.142] - 2024-07-12

### Changed

- Used `adguard_ext_chromium_mv3` for `ext_chromium_mv3` platform in the platforms configuration
instead of `adguard_ext_chromium`
- Updated [@adguard/filters-downloader] to v2.2.2
- Updated [@adguard/scriptlets] to v1.11.6
- Updated [@adguard/tsurlfilter] to v2.2.21

[v1.1.142]: https://github.com/AdguardTeam/FiltersCompiler/compare/v1.1.141...v1.1.142


## [v1.1.141] - 2024-07-02

### Changed
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
},
"dependencies": {
"@adguard/extended-css": "^2.0.56",
"@adguard/filters-downloader": "^2.2.1",
"@adguard/scriptlets": "^1.11.1",
"@adguard/tsurlfilter": "2.2.20",
"@adguard/filters-downloader": "^2.2.2",
"@adguard/scriptlets": "^1.11.6",
"@adguard/tsurlfilter": "2.2.21",
"ajv": "^8.11.0",
"child_process": ">=1.0.2",
"jsdom": "^21.1.1",
Expand Down
6 changes: 5 additions & 1 deletion src/main/platforms-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ module.exports = {
'EXTENSION_CHROMIUM': {
'platform': 'ext_chromium',
'path': 'extension/chromium',
'expires': '10 days',
'configuration': {
'removeRulePatterns': CHROMIUM_BASED_EXTENSION_PATTERNS,
'replacements': null,
Expand All @@ -611,12 +612,13 @@ module.exports = {
},
'defines': {
'adguard': true,
'adguard_ext_chromium': true,
'adguard_ext_chromium_mv3': true,
},
},
'EXTENSION_EDGE': {
'platform': 'ext_edge',
'path': 'extension/edge',
'expires': '10 days',
'configuration': {
'removeRulePatterns': CHROMIUM_BASED_EXTENSION_PATTERNS,
'replacements': null,
Expand All @@ -631,6 +633,7 @@ module.exports = {
'EXTENSION_OPERA': {
'platform': 'ext_opera',
'path': 'extension/opera',
'expires': '10 days',
'configuration': {
'removeRulePatterns': CHROMIUM_BASED_EXTENSION_PATTERNS,
'replacements': null,
Expand All @@ -645,6 +648,7 @@ module.exports = {
'EXTENSION_FIREFOX': {
'platform': 'ext_ff',
'path': 'extension/firefox',
'expires': '10 days',
'configuration': {
'removeRulePatterns': [
...HTML_FILTERING_MODIFIER_PATTERNS,
Expand Down
10 changes: 10 additions & 0 deletions src/test/builder.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,16 @@ describe('Test builder', () => {
expect(elseLines.includes('ios_rule')).toBeFalsy();
expect(elseLines.includes('non_ios_rule')).toBeTruthy();
});

it('filters4.txt - adguard_ext_chromium_mv3 constant for the if directive', async () => {
const ifContent = await readFile(path.join(platformsDir, 'chromium-mv3', 'filters', '4.txt'));
expect(ifContent).toBeTruthy();

const ifLines = ifContent.split(/\r?\n/);
expect(ifLines.length).toEqual(23);
expect(ifLines.includes('chrome_mv3_specific_rule')).toBeTruthy();
expect(ifLines.includes('ios_rule')).toBeFalsy();
});
});

describe('platformsIncluded directive', () => {
Expand Down
8 changes: 7 additions & 1 deletion src/test/resources/filters/filter_4_Directives/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,11 @@
"subscriptionUrl": "https://example.com/",
"tags": [],
"trustLevel": "full",
"platformsIncluded": ["mac", "ios", "ext_ublock", "ext_edge"]
"platformsIncluded": [
"mac",
"ios",
"ext_ublock",
"ext_edge",
"ext_chromium_mv3"
]
}
3 changes: 3 additions & 0 deletions src/test/resources/filters/filter_4_Directives/template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
!#if (!ublock)
if_not_ublock
!#endif
!#if (adguard_ext_chromium_mv3)
chrome_mv3_specific_rule
!#endif
!#if (adguard_ext_chromium && adguard_ext_edge)
if_edge_chromium
!#endif
Expand Down
12 changes: 12 additions & 0 deletions src/test/resources/platforms.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,18 @@
"adguard_ext_chromium": true
}
},
"EXTENSION_CHROMIUM_MV3": {
"platform": "ext_chromium_mv3",
"path": "chromium-mv3",
"configuration": {
"removeRulePatterns": false,
"ignoreRuleHints": false
},
"defines": {
"adguard": true,
"adguard_ext_chromium_mv3": true
}
},
"EXTENSION_EDGE": {
"platform": "ext_edge",
"path": "edge",
Expand Down
26 changes: 13 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,29 @@
resolved "https://registry.npmjs.org/@adguard/extended-css/-/extended-css-2.0.56.tgz"
integrity sha512-RMPRGZ80kM6KiKRR0K2DUOD0+2CiadBk+G6zYBrRmzk4lD71Cipv2b9/rRy9Fdh41ipoApZsQdbJZozXFsM8RA==

"@adguard/filters-downloader@^2.2.1":
version "2.2.1"
resolved "https://registry.yarnpkg.com/@adguard/filters-downloader/-/filters-downloader-2.2.1.tgz#88f5f0bf3979d193cdb48b78802661195827a01d"
integrity sha512-hzfkPkhPhfj/WXOW/ieTO26izXYdmbYX/9Mp1Q9rKLD4Nl7A+hrO5qLFhz+UVAAnecFQP0PS0Yd8u7FItSF9Aw==
"@adguard/filters-downloader@^2.2.2":
version "2.2.2"
resolved "https://registry.yarnpkg.com/@adguard/filters-downloader/-/filters-downloader-2.2.2.tgz#ec4c9a5a2cbbaf5c3cd974c3f4b94b11b86c57a5"
integrity sha512-7seM81E2QvvgfgC0uiK1ayYLBuRHiRedqQO4xAwpC7x+d1UOyu+pDZxOy3eYW7TMTv+Nd8KrpINPI5RrCZbZ0w==
dependencies:
"@adguard/diff-builder" "1.0.17"
axios "1.6.2"
crypto-js "^4.2.0"

"@adguard/scriptlets@^1.11.1":
version "1.11.1"
resolved "https://registry.yarnpkg.com/@adguard/scriptlets/-/scriptlets-1.11.1.tgz#580d90546068df278f22d3e6af0887c608e1b6d2"
integrity sha512-HRDgDeHmYXEvplVec9ABOwV6Hwh9nN5E6rMSdb8yioPrHsj5orI5BQ2ABz+s2JgC9fjshauvk818jWTtDxX9aw==
"@adguard/scriptlets@^1.11.6":
version "1.11.6"
resolved "https://registry.yarnpkg.com/@adguard/scriptlets/-/scriptlets-1.11.6.tgz#85ffb276dc142fdf6a7becbfcdc6ba494adb14c0"
integrity sha512-ArHRCGGOprZNQet+zpNNPWo8O4/Y/TdJ3k1y7XlKDE/FlEo/BDBDqD0GCYthAXEPtJvnmIFBOyV1MhlONqhM1A==
dependencies:
"@babel/runtime" "^7.20.13"
js-yaml "^3.13.1"

"@adguard/[email protected].20":
version "2.2.20"
resolved "https://registry.yarnpkg.com/@adguard/tsurlfilter/-/tsurlfilter-2.2.20.tgz#cc2a5a15fc2ee739148ff39c9019b961ad1c5f75"
integrity sha512-t4xyLkXGmMZgqiwe7aN9ZRuD1tN8f4luYBk5VCsdveSNFIzXNcoIDokglWw8c/HpUVrV48NeW8d0upgB1SE36Q==
"@adguard/[email protected].21":
version "2.2.21"
resolved "https://registry.yarnpkg.com/@adguard/tsurlfilter/-/tsurlfilter-2.2.21.tgz#fb3c0242cf3d8481981795bd745e88a31ae93ec7"
integrity sha512-vjJEKT3LwY2wV5uXLU/nOFKMTryFv2RmfDPG7RNqy0JWDNLWtfNq2eOfo5ANywELGhs6YBSVHnQDTECButN4Uw==
dependencies:
"@adguard/scriptlets" "^1.11.1"
"@adguard/scriptlets" "^1.11.6"
cidr-tools "^6.4.1"
commander "9.4.1"
is-cidr "4.0.2"
Expand Down

0 comments on commit 0aaf332

Please sign in to comment.