Skip to content

Commit

Permalink
AG-37637 Adding support for ABP CSS injections. #224
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 69f7783
Author: jellizaveta <[email protected]>
Date:   Thu Dec 19 18:57:46 2024 +0300

    remove redundant comment

commit b955c44
Author: jellizaveta <[email protected]>
Date:   Thu Dec 19 18:56:49 2024 +0300

    update changelog, add test

commit 688f78c
Author: jellizaveta <[email protected]>
Date:   Thu Dec 19 18:51:48 2024 +0300

    bamp agtree to 2.3.0
  • Loading branch information
jellizaveta committed Dec 19, 2024
1 parent 2abd451 commit 31ccf5c
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 39 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ The format is based on [Keep a Changelog][keepachangelog], and this project adhe
[keepachangelog]: https://keepachangelog.com/en/1.0.0/
[semver]: https://semver.org/spec/v2.0.0.html

## [2.1.3] - 2024-12-19

## Added

- Support for ABP CSS injections [#224].

## Changed

- Updated [@adguard/agtree] to `v2.3.0`.

[2.1.3]: https://github.com/AdguardTeam/AGLint/compare/v2.1.2...v2.1.3
[#224]: https://github.com/AdguardTeam/AGLint/issues/224

## [2.1.2] - 2024-11-25

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"typescript": "^4.9.5"
},
"dependencies": {
"@adguard/agtree": "^2.0.2",
"@adguard/agtree": "^2.3.0",
"@adguard/ecss-tree": "^1.1.0",
"@inquirer/checkbox": "^1.3.7",
"@inquirer/select": "^1.2.7",
Expand Down
14 changes: 14 additions & 0 deletions test/linter/rules/no-invalid-css-syntax.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ describe('no-invalid-css-syntax', () => {
});
});

test('support ABP syntax CSS injection', () => {
expect(
linter.lint(
[
'example.com###banner {remove:true;}',
'example.com###banner {display:none!important;}',
'example.com###banner { background: pink !important; }',
].join(NEWLINE),
),
).toMatchObject({
problems: [],
});
});

test('should detect invalid CSS', () => {
expect(
linter.lint(
Expand Down
75 changes: 37 additions & 38 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,24 @@
# yarn lockfile v1


"@adguard/agtree@^2.0.2":
version "2.0.2"
resolved "https://registry.yarnpkg.com/@adguard/agtree/-/agtree-2.0.2.tgz#8932a645016c447c0d70707380bb6cc2efe664c4"
integrity sha512-T+fH4qi+UBM8xVQyxPbw8bagCkeBvBbf2AzQYaP3YqO++pmuhTSBE5uYChwH+ZJSQaFjCTACVxdsEbsA5UFyqg==
"@adguard/agtree@^2.3.0":
version "2.3.0"
resolved "https://registry.yarnpkg.com/@adguard/agtree/-/agtree-2.3.0.tgz#9cd92572cf35c72ca641b41c6c02da1c0c72ab10"
integrity sha512-MeaTncLxXh/ERIXYAOZMEG7TTtYfxyGPIwS4Eb6sqM3kvgaCsIKRAOEDqbMHaYrtR9KBX+l5MlsdTKdkaD3SgA==
dependencies:
"@adguard/css-tokenizer" "^1.0.0"
"@adguard/css-tokenizer" "^1.1.1"
clone-deep "^4.0.1"
is-ip "3.1.0"
json5 "^2.2.3"
semver "^7.5.3"
sprintf-js "^1.1.3"
tldts "^5.7.112"
xregexp "^5.1.1"
zod "3.21.4"

"@adguard/css-tokenizer@^1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@adguard/css-tokenizer/-/css-tokenizer-1.0.0.tgz#670c011ccba42bdbc5e10717cf6d6daadec7105b"
integrity sha512-23yhZWGZ4+XuYQslzvORx8fwsUmVOOQgyJcGOpyaH097KOJTniVF9UeaxEZpdJIhErJ6zDqPx2ifGer5QdZ0zw==
"@adguard/css-tokenizer@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@adguard/css-tokenizer/-/css-tokenizer-1.1.1.tgz#9f5cc45c5a2bd16de9a8924524621270d8caedfd"
integrity sha512-oDNlMegMJIRZ9v6JuAXFOQzTmkKz3ERILV9rTvbWYLDApOZ8jqwil1fEeJbjGFR37OHN6MVU55ef9NcxZCZrig==

"@adguard/ecss-tree@^1.1.0":
version "1.1.0"
Expand Down Expand Up @@ -959,14 +958,6 @@
resolved "https://registry.yarnpkg.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310"
integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==

"@babel/runtime-corejs3@^7.16.5":
version "7.22.10"
resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.22.10.tgz#5ecc3d32faa70009f084cc2e087d79e5f5cdcca9"
integrity sha512-IcixfV2Jl3UrqZX4c81+7lVg5++2ufYJyAFW3Aux/ZTvY6LVYYhJ9rMgnbX0zGVq6eqfVpnoatTjZdVki/GmWA==
dependencies:
core-js-pure "^3.30.2"
regenerator-runtime "^0.14.0"

"@babel/runtime@^7.8.4":
version "7.22.5"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.5.tgz#8564dd588182ce0047d55d7a75e93921107b57ec"
Expand Down Expand Up @@ -2537,11 +2528,6 @@ core-js-compat@^3.30.1, core-js-compat@^3.30.2:
dependencies:
browserslist "^4.21.5"

core-js-pure@^3.30.2:
version "3.32.0"
resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.32.0.tgz#5d79f85da7a4373e9a06494ccbef995a4c639f8b"
integrity sha512-qsev1H+dTNYpDUEURRuOXMvpdtAnNEvQWS/FMJ2Vb5AY8ZP4rAPQldkE27joykZPJTe0+IVgHZYh1P5Xu1/i1g==

create-require@^1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333"
Expand Down Expand Up @@ -4793,11 +4779,6 @@ regenerator-runtime@^0.13.11:
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9"
integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==

regenerator-runtime@^0.14.0:
version "0.14.0"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz#5e19d68eb12d486f797e15a3c6a918f7cec5eb45"
integrity sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==

regenerator-transform@^0.15.1:
version "0.15.1"
resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.15.1.tgz#f6c4e99fc1b4591f780db2586328e4d9a9d8dc56"
Expand Down Expand Up @@ -5112,7 +5093,16 @@ string-length@^4.0.1:
char-regex "^1.0.2"
strip-ansi "^6.0.0"

"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
"string-width-cjs@npm:string-width@^4.2.0":
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"

string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand Down Expand Up @@ -5157,7 +5147,14 @@ string.prototype.trimstart@^1.0.6:
define-properties "^1.1.4"
es-abstract "^1.20.4"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1", [email protected], strip-ansi@^6.0.0, strip-ansi@^6.0.1:
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"

[email protected], strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand Down Expand Up @@ -5497,7 +5494,7 @@ word-wrap@^1.2.3:
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c"
integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand All @@ -5515,6 +5512,15 @@ wrap-ansi@^6.2.0:
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"
Expand Down Expand Up @@ -5542,13 +5548,6 @@ xmlcreate@^2.0.4:
resolved "https://registry.yarnpkg.com/xmlcreate/-/xmlcreate-2.0.4.tgz#0c5ab0f99cdd02a81065fa9cd8f8ae87624889be"
integrity sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg==

xregexp@^5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-5.1.1.tgz#6d3fe18819e3143aaf52f9284d34f49a59583ebb"
integrity sha512-fKXeVorD+CzWvFs7VBuKTYIW63YD1e1osxwQ8caZ6o1jg6pDAbABDG54LCIq0j5cy7PjRvGIq6sef9DYPXpncg==
dependencies:
"@babel/runtime-corejs3" "^7.16.5"

y18n@^5.0.5:
version "5.0.8"
resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55"
Expand Down

0 comments on commit 31ccf5c

Please sign in to comment.