@whotracksme/reporting 12.1.1 → 12.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
# v12.1.3 (Wed Sep 23 2026)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- fix video search detection [#232](https://github.com/whotracksme/webextension-packages/pull/232) ([@philipp-classen](https://github.com/philipp-classen))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- Philipp Claßen ([@philipp-classen](https://github.com/philipp-classen))
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# v12.1.2 (Fri Sep 18 2026)
|
|
14
|
+
|
|
15
|
+
#### 🐛 Bug Fix
|
|
16
|
+
|
|
17
|
+
- "firstMatch" needs to wait for transforms to succeed before accepting [#231](https://github.com/whotracksme/webextension-packages/pull/231) ([@philipp-classen](https://github.com/philipp-classen))
|
|
18
|
+
|
|
19
|
+
#### Authors: 1
|
|
20
|
+
|
|
21
|
+
- Philipp Claßen ([@philipp-classen](https://github.com/philipp-classen))
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
1
25
|
# v12.1.1 (Mon Sep 14 2026)
|
|
2
26
|
|
|
3
27
|
#### 🐛 Bug Fix
|
package/package.json
CHANGED
|
@@ -477,7 +477,7 @@ export function lookupBuiltinTransform(name) {
|
|
|
477
477
|
* to disable clients that do not meet the minimum requirements of the
|
|
478
478
|
* current patterns.
|
|
479
479
|
*/
|
|
480
|
-
const PATTERN_DSL_VERSION =
|
|
480
|
+
const PATTERN_DSL_VERSION = 10;
|
|
481
481
|
|
|
482
482
|
/**
|
|
483
483
|
* "Magic" empty rule set, which exists only if patterns were loaded, but
|
|
@@ -85,9 +85,10 @@ function findFirstMatch(rootItem, selectorDef, baseURI) {
|
|
|
85
85
|
// special case: allows to define multiple rules (first matching rule wins)
|
|
86
86
|
if (selectorDef.firstMatch) {
|
|
87
87
|
for (const { select, attr, transform = [] } of selectorDef.firstMatch) {
|
|
88
|
-
const match = runSelector(rootItem, select, attr, baseURI)
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
const match = runSelector(rootItem, select, attr, baseURI);
|
|
89
|
+
const value = runTransforms(match, transform);
|
|
90
|
+
if (value !== null) {
|
|
91
|
+
return value;
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
94
|
return null;
|
|
@@ -31,8 +31,8 @@ const URL_PATTERNS = [
|
|
|
31
31
|
{
|
|
32
32
|
category: 'search-gov',
|
|
33
33
|
regexp:
|
|
34
|
-
/^https:[/][/][^/]*[.]google[.].*?[#?&;]((q=[^&]+&([^&]+&)*udm=7)|(udm=7&([^&]+&)*q=[^&]+))/,
|
|
35
|
-
prefix: 'search?udm=
|
|
34
|
+
/^https:[/][/][^/]*[.]google[.].*?[#?&;]((q=[^&]+&([^&]+&)*udm=(vids|7))|(udm=(vids|7)&([^&]+&)*q=[^&]+))/,
|
|
35
|
+
prefix: 'search?udm=vids&q=',
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
category: 'search-go',
|
|
@@ -236,6 +236,62 @@ describe('#SearchExtractor', function () {
|
|
|
236
236
|
});
|
|
237
237
|
});
|
|
238
238
|
|
|
239
|
+
it('should fall through in "firstMatch" if the transforms reject a match', function () {
|
|
240
|
+
runScenario({
|
|
241
|
+
url: 'http://example.test/x?q=some-query',
|
|
242
|
+
query: 'some-query',
|
|
243
|
+
category: 'example-test',
|
|
244
|
+
html: `
|
|
245
|
+
<!DOCTYPE html>
|
|
246
|
+
<html>
|
|
247
|
+
<body>
|
|
248
|
+
<a id="link" href="https://example.test/some/path">link</a>
|
|
249
|
+
</body>
|
|
250
|
+
</html>`,
|
|
251
|
+
patterns: {
|
|
252
|
+
'example-test': {
|
|
253
|
+
input: {
|
|
254
|
+
'html body': {
|
|
255
|
+
first: {
|
|
256
|
+
u: {
|
|
257
|
+
firstMatch: [
|
|
258
|
+
{
|
|
259
|
+
// selector matches, but the transforms reject it
|
|
260
|
+
select: 'a#link',
|
|
261
|
+
attr: 'href',
|
|
262
|
+
transform: [
|
|
263
|
+
['selectFirstMatch', 'will-not-match'],
|
|
264
|
+
['minLength', 1],
|
|
265
|
+
],
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
select: 'a#link',
|
|
269
|
+
attr: 'href',
|
|
270
|
+
transform: [['maskU']],
|
|
271
|
+
},
|
|
272
|
+
],
|
|
273
|
+
},
|
|
274
|
+
},
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
output: {
|
|
278
|
+
'test-action': {
|
|
279
|
+
fields: [{ key: 'u', source: 'html body' }],
|
|
280
|
+
},
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
mustContain: [
|
|
285
|
+
{
|
|
286
|
+
action: 'test-action',
|
|
287
|
+
payload: {
|
|
288
|
+
u: 'https://example.test/some/path',
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
],
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
|
|
239
295
|
it('should not double-encode links', function () {
|
|
240
296
|
// Note: this URL has an encoded Umlaut. Depending on the DOMParser and
|
|
241
297
|
// the mechanism to extract the URL (elem.href vs elem.getAttribute('href'),
|
|
@@ -86,18 +86,24 @@ describe('#UrlAnalyzer', function () {
|
|
|
86
86
|
'https://www.google.com/search?sca_esv=332c1457e26e21ac&q=cat&udm=7&fbs=AEQNm0A6bwEop21ehxKWq5cj-cHa02QUie7apaStVTrDAEoT1CkRGSL-1wA3X2bR5dRYtRFmaZPN2OTOpML6Nzk89AWekIwYOcUmK2FR_flIZE9vn1EXAsBBBo_DOK7IqycIPr8oX9r_c2Y_H6YSW9sBv2zzlY5ifH_0oIYtOJi92VlQNOEZ0mbOIl6RYJLN-zdoMIA2J145wwYej0xWX2q5hfw8qzQw7g&sa=X&ved=2ahUKEwjPk4Dr2e-JAxWBgf0HHfEsNsYQtKgLegQIGhAB&biw=882&bih=1002&dpr=0.9':
|
|
87
87
|
{
|
|
88
88
|
query: 'cat',
|
|
89
|
-
doublefetchUrl: 'https://www.google.com/search?udm=
|
|
89
|
+
doublefetchUrl: 'https://www.google.com/search?udm=vids&q=cat',
|
|
90
90
|
},
|
|
91
91
|
'https://www.google.de/search?sca_esv=332c1457e26e21ac&q=katze&udm=7&fbs=AEQNm0A6bwEop21ehxKWq5cj-cHa02QUie7apaStVTrDAEoT1CkRGSL-1wA3X2bR5dRYtRGv3dh0WX48pQ0OijG3Ir_Ily36WNjIM66TUeQQm6v5pCxPr2gtqfjkC7ffv6Tr7pov6Kj4r20q4qdHCSHuZ8l9l_oCqEwoxOcaGtTQ9oNU0Tr95ug&sa=X&ved=2ahUKEwjDvfjh3u-JAxVY3AIHHUZkIcUQtKgLegQIIhAB&biw=958&bih=898&dpr=1':
|
|
92
92
|
{
|
|
93
93
|
query: 'katze',
|
|
94
|
-
doublefetchUrl: 'https://www.google.de/search?udm=
|
|
94
|
+
doublefetchUrl: 'https://www.google.de/search?udm=vids&q=katze',
|
|
95
95
|
},
|
|
96
96
|
'https://www.google.co.uk/search?sca_esv=332c1457e26e21ac&q=British+Shorthair&udm=7&fbs=AEQNm0A6bwEop21ehxKWq5cj-cHa02QUie7apaStVTrDAEoT1CkRGSL-1wA3X2bR5dRYtRGv3dh0WX48pQ0OijG3Ir_I75oFM8mN67hQ5D8L2f_4aId2Ld_vPyIeJPxAzy5CcO-5UtDBOirlUmpUozWrwxQJT3cKh-XbNOVVNXNxn1wGeq30DpZD8xJuzexvjnEe-Ql_N82o&sa=X&ved=2ahUKEwi5hIO_2u-JAxVm3AIHHXc1E7UQtKgLegQIEBAB':
|
|
97
97
|
{
|
|
98
98
|
query: 'British Shorthair',
|
|
99
99
|
doublefetchUrl:
|
|
100
|
-
'https://www.google.co.uk/search?udm=
|
|
100
|
+
'https://www.google.co.uk/search?udm=vids&q=British+Shorthair',
|
|
101
|
+
},
|
|
102
|
+
'https://www.google.com/search?q=katze&sca_esv=ab3964043a1b023d&udm=vids&biw=1916&bih=1063&ei=ILOyau-_Jq-Dxc8PufzXoQQ&ved=2ahUKEwjvz5Lu04KXAxWvQfEDHTn-NUQQ4dUDegQIBRAM&uact=5&oq=katze&gs_lp=EhZnd3Mtd2l6LW1vZGVsZXNzLXZpZGVvIgVrYXR6ZTINEAAYgAQYigUYQxixAzINEAAYgAQYigUYQxixAzIIEAAYgAQYsQMyCBAAGIAEGLEDMgUQABiABDIIEAAYgAQYsQMyCBAAGIAEGLEDMggQABiABBixAzIIEAAYgAQYsQMyCBAAGIAEGLEDSN4OUPIHWKoLcAJ4AJABAJgBL6AB2wGqAQE1uAEDyAEA-AEBmAIHoAL9AcICDhAAGIAEGIoFGLEDGIMBwgILEAAYgAQYsQMYgwHCAgoQABiABBiKBRhDwgIGEAAYBxgemAMAiAYBkgcBN6AH7RayBwE1uAfzAcIHAzItN8gHGYAIAQ&sclient=gws-wiz-modeless-video':
|
|
103
|
+
{
|
|
104
|
+
query: 'katze',
|
|
105
|
+
doublefetchUrl:
|
|
106
|
+
'https://www.google.com/search?udm=vids&q=katze',
|
|
101
107
|
},
|
|
102
108
|
},
|
|
103
109
|
'search-go': {
|