From 2adf5b5f45f6c9f33b11a67a7e018dc9605ac85c Mon Sep 17 00:00:00 2001 From: Maxim Topciu Date: Mon, 8 Jul 2024 16:59:52 +0300 Subject: [PATCH] AG-593 fix element to string for elements Merge in ADGUARD-FILTERS/tsurlfilter from fix/AG-593-1 to master Squashed commit of the following: commit 89ddb5c5d77148e74c0c30923ff79b28096890e5 Merge: 879813de 72c3e2cd Author: Maxim Topciu Date: Mon Jul 8 16:53:52 2024 +0300 Merge remote-tracking branch 'origin/master' into fix/AG-593-1 commit 879813de287a206169c44e0d8edcb37627ca2330 Author: Maxim Topciu Date: Mon Jul 8 16:36:03 2024 +0300 AG-593 update changelog commit 8f452ce4c0ec1c10c45daf68366218461fe38783 Author: Maxim Topciu Date: Mon Jul 8 16:29:49 2024 +0300 AG-593 fix element to string for elements --- packages/tswebextension/CHANGELOG.md | 8 ++++++++ .../src/lib/mv2/content-script/css-hits-counter.ts | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/tswebextension/CHANGELOG.md b/packages/tswebextension/CHANGELOG.md index eb1cb9f47..40d1cff3c 100644 --- a/packages/tswebextension/CHANGELOG.md +++ b/packages/tswebextension/CHANGELOG.md @@ -8,6 +8,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +## [1.0.28] - 2024-07-08 + +### Fixed + +- CssHitsCounter logs elements blocked by elemhide rules. + +[1.0.28]: https://github.com/AdguardTeam/tsurlfilter/releases/tag/tswebextension-v1.0.28 + ## [1.0.27] - 2024-07-08 ### Changed diff --git a/packages/tswebextension/src/lib/mv2/content-script/css-hits-counter.ts b/packages/tswebextension/src/lib/mv2/content-script/css-hits-counter.ts index 0fac3e64e..78484601c 100644 --- a/packages/tswebextension/src/lib/mv2/content-script/css-hits-counter.ts +++ b/packages/tswebextension/src/lib/mv2/content-script/css-hits-counter.ts @@ -260,7 +260,7 @@ export class CssHitsCounter { elements: NodeListOf | Element[], start: number, length: number | null, - ): { filterId: number; ruleText: string; element: string }[] { + ): ICountedElement[] { const RULE_FILTER_SEPARATOR = ';'; start = start || 0; length = length || elements.length; @@ -284,7 +284,7 @@ export class CssHitsCounter { result.push({ filterId, ruleText, - element: ElementUtils.elementToString(element), + element: this.elementToString ? ElementUtils.elementToString(element) : element, }); }