Skip to content

Commit

Permalink
update libs. AG-21027, AG-21392
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit a8dde0b
Author: Slava Leleka <[email protected]>
Date:   Fri Apr 21 12:15:44 2023 +0300

    update changelog

commit bae308c
Author: Slava Leleka <[email protected]>
Date:   Fri Apr 21 11:59:14 2023 +0300

    fix changelog typo

commit 0746e35
Author: Slava Leleka <[email protected]>
Date:   Fri Apr 21 11:50:23 2023 +0300

    update changelog

commit 51d63d0
Author: Slava Leleka <[email protected]>
Date:   Fri Apr 21 11:50:12 2023 +0300

    update libs

commit 6ef0125
Author: Slava Leleka <[email protected]>
Date:   Tue Apr 18 14:55:24 2023 +0300

    fix tsurlfilter import

commit 7d2bea8
Author: Slava Leleka <[email protected]>
Date:   Wed Apr 5 22:44:50 2023 +0300

    fix tsurlfilter imports

commit c9bdccd
Author: Slava Leleka <[email protected]>
Date:   Wed Apr 5 22:44:11 2023 +0300

    fix validator

commit 243b8d7
Author: Slava Leleka <[email protected]>
Date:   Wed Apr 5 22:42:37 2023 +0300

    fix removeparam tests

commit 768d009
Author: Slava Leleka <[email protected]>
Date:   Wed Apr 5 22:41:03 2023 +0300

    fix extended-css-validator

commit 1e89c57
Author: Slava Leleka <[email protected]>
Date:   Wed Apr 5 22:40:02 2023 +0300

    update jsdom to v21.1.1
  • Loading branch information
slavaleleka committed Apr 21, 2023
1 parent a843db5 commit 8c133da
Show file tree
Hide file tree
Showing 6 changed files with 206 additions and 77 deletions.
59 changes: 45 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,66 @@
# Filters Compiler Changelog

All notable changes to this project will be documented in this file.
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.79

## [v1.1.82] - 2023-04-21

### Changed

- Updated ExtendedCss to v2.0.52
- Updated Scriptlets to v1.9.7
- Updated TSUrlFilter to v2.0.3


## [v1.1.79] - 2023-03-09

### Added

- Locales validation `filters_i18n` schema for filter 23


## v1.1.77
## [v1.1.77] - 2023-03-01

### Added

- Build .js copies of `filters.json` and `filters_i18n.json`


## v1.1.76
## [v1.1.76] - 2023-02-01

### Changed

- Updated ExtendedCss to v2.0.45
- Updated TSUrlFilter to 1.0.73


## v1.1.75
## [v1.1.75] - 2023-01-19

### Changed

- Updated Scriptlets to v1.8.2
- Updated TSUrlFilter to 1.0.72


## v1.1.73
## [v1.1.73] - 2022-12-28

### Changed

- Updated TSUrlFilter to v1.0.68:
- validation of `$hls` modifier


## v1.1.72
## [v1.1.72] - 2022-12-27

### Changed

- Updated TSUrlFilter to v1.0.67:
- validation of `$jsonprune` modifier


## v1.1.71
## [v1.1.71] - 2022-12-23

### Changed

Expand All @@ -70,23 +83,23 @@
- Support of `$webrtc` modifier


## v1.1.69
## [v1.1.69] - 2022-12-19

### Changed

- Updated Scriptlets to v1.7.14
- Updated TSUrlFilter to 1.0.64


## v1.1.68
## [v1.1.68] - 2022-12-14

### Changed

- Updated Scriptlets to v1.7.13
- Updated TSUrlFilter to 1.0.63


## v1.1.67
## [v1.1.67] - 2022-12-06

### Changed

Expand All @@ -95,28 +108,28 @@
- Updated TSUrlFilter to 1.0.57


## v1.1.66
## [v1.1.66] - 2022-12-01

### Changed

- Updated ExtendedCss to v2.0.18


## v1.1.65
## [v1.1.65] - 2022-11-29

### Changed

- Updated ExtendedCss to v2.0.15


## v1.1.64
## [v1.1.64] - 2022-11-28

### Changed

- Updated ExtendedCss to v2.0.12


## v1.1.63
## [v1.1.63] - 2022-11-22

### Added

Expand All @@ -125,3 +138,21 @@
### Changed

- Updated TSUrlFilter to v1.0.51, Scriptlets to v1.7.3


[Unreleased]: https://github.com/AdguardTeam/FiltersCompiler/compare/v1.1.82...HEAD
[v1.1.82]: https://github.com/AdguardTeam/FiltersCompiler/compare/v1.1.79...v1.1.82
[v1.1.79]: https://github.com/AdguardTeam/FiltersCompiler/compare/v1.1.77...v1.1.79
[v1.1.77]: https://github.com/AdguardTeam/FiltersCompiler/compare/v1.1.76...v1.1.77
[v1.1.76]: https://github.com/AdguardTeam/FiltersCompiler/compare/v1.1.75...v1.1.76
[v1.1.75]: https://github.com/AdguardTeam/FiltersCompiler/compare/v1.1.73...v1.1.75
[v1.1.73]: https://github.com/AdguardTeam/FiltersCompiler/compare/v1.1.72...v1.1.73
[v1.1.72]: https://github.com/AdguardTeam/FiltersCompiler/compare/v1.1.71...v1.1.72
[v1.1.71]: https://github.com/AdguardTeam/FiltersCompiler/compare/v1.1.69...v1.1.71
[v1.1.69]: https://github.com/AdguardTeam/FiltersCompiler/compare/v1.1.68...v1.1.69
[v1.1.68]: https://github.com/AdguardTeam/FiltersCompiler/compare/v1.1.67...v1.1.68
[v1.1.67]: https://github.com/AdguardTeam/FiltersCompiler/compare/v1.1.66...v1.1.67
[v1.1.66]: https://github.com/AdguardTeam/FiltersCompiler/compare/v1.1.65...v1.1.66
[v1.1.65]: https://github.com/AdguardTeam/FiltersCompiler/compare/v1.1.64...v1.1.65
[v1.1.64]: https://github.com/AdguardTeam/FiltersCompiler/compare/v1.1.63...v1.1.64
[v1.1.63]: https://github.com/AdguardTeam/FiltersCompiler/compare/v1.1.61...v1.1.63
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
"prepare": "husky install"
},
"dependencies": {
"@adguard/extended-css": "^2.0.45",
"@adguard/scriptlets": "^1.8.2",
"@adguard/tsurlfilter": "^1.0.73",
"@adguard/extended-css": "^2.0.52",
"@adguard/scriptlets": "^1.9.7",
"@adguard/tsurlfilter": "^2.0.3",
"ajv": "^8.11.0",
"child_process": ">=1.0.2",
"filters-downloader": "git+https://github.com/AdguardTeam/FiltersDownloader.git#v1.1.12",
"jsdom": "^20.0.2",
"jsdom": "^21.1.1",
"md5": "2.3.0",
"moment": "^2.29.4",
"utf8": "^3.0.0"
Expand Down
4 changes: 4 additions & 0 deletions src/main/utils/extended-css-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ module.exports = (function () {
* ExtendedCss is not supposed to work without window environment,
* so we pass some wrapper dummy.
*/
const { TextEncoder, TextDecoder } = require('util');
global.TextEncoder = TextEncoder;
global.TextDecoder = TextDecoder;

const jsdom = require('jsdom');
const { JSDOM } = jsdom;
const dom = new JSDOM('<!DOCTYPE html><p>Empty</p>');
Expand Down
4 changes: 4 additions & 0 deletions src/main/validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ const validate = function (list, excluded, invalid = [], filterName) { // eslint
return false;
}

if (convertedRules.length === 0) {
return false;
}

for (let i = 0; i < convertedRules.length; i += 1) {
const convertedRuleText = convertedRules[i];

Expand Down
4 changes: 3 additions & 1 deletion src/test/validator.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ describe('validator', () => {
describe('validate removeparam rules', () => {
describe('valid', () => {
const validRules = [
'$removeparam=gclid|yclid|fbclid',
'$removeparam=/source|campaign/',
'||test.com^$removeparam=qwerty',
'||test.com^$removeparam=/qwerty/i',
'@@||example.com$removeparam',
Expand All @@ -581,6 +581,8 @@ describe('validator', () => {
describe('invalid', () => {
const invalidRules = [
'||example.org^$removeparam=p,popup',
// error: multiple values are not allowed
'$removeparam=source|campaign',
];
test.each(invalidRules)('%s', (rule) => {
expect(validator.validate([rule])).toHaveLength(0);
Expand Down
Loading

0 comments on commit 8c133da

Please sign in to comment.