Skip to content

Commit f8288ac

Browse files
committed
AG-44299 Added support of ext_opera_mv3 platform
Squashed commit of the following: commit 6538484 Author: Kurbanali Ruslan <[email protected]> Date: Wed Aug 6 10:18:08 2025 +0500 updated changelog commit 91e5abc Author: Kurbanali Ruslan <[email protected]> Date: Tue Aug 5 19:00:11 2025 +0500 bump version commit 795deeb Author: Kurbanali Ruslan <[email protected]> Date: Tue Aug 5 11:55:07 2025 +0500 AG-44299 Added support of `ext_opera_mv3` platform
1 parent 697c24d commit f8288ac

File tree

7 files changed

+60
-3
lines changed

7 files changed

+60
-3
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [v3.1.0] - 2025-08-06
9+
10+
### Added
11+
12+
- Support of `ext_opera_mv3` platform.
13+
14+
[v3.1.0]: https://github.com/AdguardTeam/FiltersCompiler/compare/v3.0.2...v3.1.0
15+
816
## [v3.0.2] - 2025-07-31
917

1018
### Added

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@adguard/filters-compiler",
3-
"version": "3.0.2",
3+
"version": "3.1.0",
44
"description": "AdGuard filters compiler",
55
"homepage": "http://adguard.com",
66
"type": "module",

src/main/platforms-config.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,8 @@ const EXTENDED_CSS_RULES_PATTERNS = [
493493
];
494494

495495
/**
496-
* Used for `EXTENSION_CHROMIUM`, `EXTENSION_CHROMIUM_MV3`, `EXTENSION_EDGE`, and `EXTENSION_OPERA` platforms.
496+
* Used for `EXTENSION_CHROMIUM`, `EXTENSION_CHROMIUM_MV3`, `EXTENSION_EDGE`,
497+
* `EXTENSION_OPERA`, and `EXTENSION_OPERA_MV3` platforms.
497498
*/
498499
const CHROMIUM_BASED_EXTENSION_PATTERNS = [
499500
...HTML_FILTERING_MODIFIER_PATTERNS,
@@ -700,6 +701,24 @@ export const platformsConfig = {
700701
'adguard_ext_chromium': true,
701702
},
702703
},
704+
'EXTENSION_OPERA_MV3': {
705+
'platform': 'ext_opera_mv3',
706+
'path': 'extension/opera-mv3',
707+
'expires': '10 days',
708+
'configuration': {
709+
'removeRulePatterns': [
710+
...CHROMIUM_BASED_EXTENSION_PATTERNS,
711+
...REDIRECT_MODIFIER_PATTERNS,
712+
],
713+
'replacements': null,
714+
'ignoreRuleHints': false,
715+
},
716+
'defines': {
717+
'adguard': true,
718+
'adguard_ext_opera_mv3': true,
719+
'adguard_ext_chromium_mv3': true,
720+
},
721+
},
703722
'EXTENSION_FIREFOX': {
704723
'platform': 'ext_ff',
705724
'path': 'extension/firefox',

test/builder.test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,16 @@ describe('Test builder', () => {
10241024
expect(ifLines.includes('ios_rule')).toBeFalsy();
10251025
});
10261026

1027+
it('filters4.txt - adguard_ext_opera_mv3 constant for the if directive', async () => {
1028+
const ifContent = await readFile(path.join(platformsDir, 'opera-mv3', 'filters', '4.txt'));
1029+
expect(ifContent).toBeTruthy();
1030+
1031+
const ifLines = ifContent.split(/\r?\n/);
1032+
expect(ifLines.length).toEqual(24);
1033+
expect(ifLines.includes('opera_mv3_specific_rule')).toBeTruthy();
1034+
expect(ifLines.includes('ios_rule')).toBeFalsy();
1035+
});
1036+
10271037
it('filters4.txt - adguard_app_cli constant for the if directive', async () => {
10281038
const ifContent = await readFile(path.join(platformsDir, 'cli', 'filters', '4.txt'));
10291039
expect(ifContent).toBeTruthy();

test/resources/filters/filter_4_Directives/metadata.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"cli",
1717
"ext_ublock",
1818
"ext_edge",
19-
"ext_chromium_mv3"
19+
"ext_chromium_mv3",
20+
"ext_opera_mv3"
2021
]
2122
}

test/resources/filters/filter_4_Directives/template.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ if_not_ublock
1212
!#if (adguard_ext_chromium_mv3)
1313
chrome_mv3_specific_rule
1414
!#endif
15+
!#if (adguard_ext_opera_mv3)
16+
opera_mv3_specific_rule
17+
!#endif
1518
!#if (adguard_ext_chromium && adguard_ext_edge)
1619
if_edge_chromium
1720
!#endif

test/resources/platforms.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,22 @@
176176
"adguard_ext_chromium": true
177177
}
178178
},
179+
"EXTENSION_OPERA_MV3": {
180+
"platform": "ext_opera_mv3",
181+
"path": "opera-mv3",
182+
"configuration": {
183+
"removeRulePatterns": [
184+
"\\$redirect-rule=",
185+
",redirect-rule="
186+
],
187+
"ignoreRuleHints": false
188+
},
189+
"defines": {
190+
"adguard": true,
191+
"adguard_ext_opera_mv3": true,
192+
"adguard_ext_chromium_mv3": true
193+
}
194+
},
179195
"TEST_REPLACEMENTS": {
180196
"platform": "test",
181197
"path": "replacements",

0 commit comments

Comments
 (0)