@whotracksme/reporting 5.1.19 → 5.1.21
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
|
+
# v5.1.21 (Mon Aug 26 2024)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- Extend the list of public search engines [#89](https://github.com/whotracksme/webextension-packages/pull/89) ([@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
|
+
# v5.1.20 (Thu Aug 01 2024)
|
|
14
|
+
|
|
15
|
+
#### 🐛 Bug Fix
|
|
16
|
+
|
|
17
|
+
- Support expansion for plain objects in deduplicator expressions [#86](https://github.com/whotracksme/webextension-packages/pull/86) ([@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
|
# v5.1.19 (Thu Aug 01 2024)
|
|
2
26
|
|
|
3
27
|
#### 🐛 Bug Fix
|
package/package.json
CHANGED
|
@@ -65,6 +65,18 @@ function extractPath(obj, path, pos = 0) {
|
|
|
65
65
|
if (results.length > 0) {
|
|
66
66
|
return { match: true, value: results };
|
|
67
67
|
}
|
|
68
|
+
} else if (obj && typeof obj === 'object') {
|
|
69
|
+
// handle plain objects
|
|
70
|
+
const results = {};
|
|
71
|
+
for (const [key, val] of Object.entries(obj)) {
|
|
72
|
+
const { match, value } = extractPath(val, path, pos + 1);
|
|
73
|
+
if (match) {
|
|
74
|
+
results[key] = value;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (Object.keys(results).length > 0) {
|
|
78
|
+
return { match: true, value: results };
|
|
79
|
+
}
|
|
68
80
|
}
|
|
69
81
|
return { match: false };
|
|
70
82
|
}
|
|
@@ -17,6 +17,11 @@ import logger from './logger';
|
|
|
17
17
|
* some optimizations (e.g. quorum checks can be skipped).
|
|
18
18
|
*/
|
|
19
19
|
const URL_PATTERNS = [
|
|
20
|
+
{
|
|
21
|
+
category: 'search-gos',
|
|
22
|
+
regexp: /^https:[/][/]scholar[.]google[.][^/]+[/]scholar.*[?&]q=/,
|
|
23
|
+
prefix: 'scholar?q=',
|
|
24
|
+
},
|
|
20
25
|
{
|
|
21
26
|
category: 'search-goi',
|
|
22
27
|
regexp:
|
|
@@ -413,6 +413,169 @@ describe('#computeDeduplicationKey', function () {
|
|
|
413
413
|
);
|
|
414
414
|
});
|
|
415
415
|
|
|
416
|
+
it('should handle the expansion of array-like objects', function () {
|
|
417
|
+
duplicatedPayload(
|
|
418
|
+
{
|
|
419
|
+
0: {
|
|
420
|
+
x: 'foo',
|
|
421
|
+
},
|
|
422
|
+
1: {
|
|
423
|
+
x: 'bar',
|
|
424
|
+
},
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
0: {
|
|
428
|
+
x: 'foo',
|
|
429
|
+
},
|
|
430
|
+
1: {
|
|
431
|
+
x: 'bar',
|
|
432
|
+
},
|
|
433
|
+
},
|
|
434
|
+
'[].x',
|
|
435
|
+
);
|
|
436
|
+
|
|
437
|
+
nonDuplicatedPayload(
|
|
438
|
+
{
|
|
439
|
+
0: {
|
|
440
|
+
x: 'foo',
|
|
441
|
+
},
|
|
442
|
+
1: {
|
|
443
|
+
x: 'bar',
|
|
444
|
+
},
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
0: {
|
|
448
|
+
x: 'foo',
|
|
449
|
+
},
|
|
450
|
+
1: {
|
|
451
|
+
x: 'not bar',
|
|
452
|
+
},
|
|
453
|
+
},
|
|
454
|
+
'[].x',
|
|
455
|
+
);
|
|
456
|
+
|
|
457
|
+
duplicatedPayload(
|
|
458
|
+
{
|
|
459
|
+
0: {
|
|
460
|
+
x: 'foo',
|
|
461
|
+
},
|
|
462
|
+
1: {
|
|
463
|
+
x: 'bar',
|
|
464
|
+
},
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
0: {
|
|
468
|
+
x: 'foo',
|
|
469
|
+
},
|
|
470
|
+
1: {
|
|
471
|
+
x: 'bar',
|
|
472
|
+
ignore: 'not part of key',
|
|
473
|
+
},
|
|
474
|
+
},
|
|
475
|
+
'[].x',
|
|
476
|
+
);
|
|
477
|
+
|
|
478
|
+
duplicatedPayload(
|
|
479
|
+
{
|
|
480
|
+
x: {
|
|
481
|
+
foo: 'foo',
|
|
482
|
+
bar: 'bar',
|
|
483
|
+
},
|
|
484
|
+
y: {
|
|
485
|
+
foo: 'foo',
|
|
486
|
+
bar: 'bar',
|
|
487
|
+
},
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
y: {
|
|
491
|
+
bar: 'bar',
|
|
492
|
+
foo: 'foo',
|
|
493
|
+
},
|
|
494
|
+
x: {
|
|
495
|
+
bar: 'bar',
|
|
496
|
+
foo: 'foo',
|
|
497
|
+
},
|
|
498
|
+
},
|
|
499
|
+
'[].foo,[].bar',
|
|
500
|
+
);
|
|
501
|
+
});
|
|
502
|
+
|
|
503
|
+
it('should handle the expansion of plain objects', function () {
|
|
504
|
+
duplicatedPayload(
|
|
505
|
+
{
|
|
506
|
+
foo: 'foo',
|
|
507
|
+
bar: 'bar',
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
bar: 'bar',
|
|
511
|
+
foo: 'foo',
|
|
512
|
+
},
|
|
513
|
+
'[]',
|
|
514
|
+
);
|
|
515
|
+
|
|
516
|
+
duplicatedPayload(
|
|
517
|
+
{
|
|
518
|
+
foo: {
|
|
519
|
+
x: 'foo',
|
|
520
|
+
},
|
|
521
|
+
bar: {
|
|
522
|
+
x: 'bar',
|
|
523
|
+
},
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
bar: {
|
|
527
|
+
x: 'bar',
|
|
528
|
+
},
|
|
529
|
+
foo: {
|
|
530
|
+
x: 'foo',
|
|
531
|
+
},
|
|
532
|
+
},
|
|
533
|
+
'[].x',
|
|
534
|
+
);
|
|
535
|
+
|
|
536
|
+
nonDuplicatedPayload(
|
|
537
|
+
{
|
|
538
|
+
foo: {
|
|
539
|
+
x: 'foo',
|
|
540
|
+
y: 'only in first elem',
|
|
541
|
+
},
|
|
542
|
+
bar: {
|
|
543
|
+
x: 'bar',
|
|
544
|
+
},
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
bar: {
|
|
548
|
+
x: 'bar',
|
|
549
|
+
},
|
|
550
|
+
foo: {
|
|
551
|
+
x: 'foo',
|
|
552
|
+
},
|
|
553
|
+
},
|
|
554
|
+
'[].x,[].y',
|
|
555
|
+
);
|
|
556
|
+
|
|
557
|
+
duplicatedPayload(
|
|
558
|
+
{
|
|
559
|
+
foo: {
|
|
560
|
+
x: 'foo',
|
|
561
|
+
y: 'only in first elem, but will be ignored',
|
|
562
|
+
},
|
|
563
|
+
bar: {
|
|
564
|
+
x: 'bar',
|
|
565
|
+
},
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
bar: {
|
|
569
|
+
x: 'bar',
|
|
570
|
+
},
|
|
571
|
+
foo: {
|
|
572
|
+
x: 'foo',
|
|
573
|
+
},
|
|
574
|
+
},
|
|
575
|
+
'[].x',
|
|
576
|
+
);
|
|
577
|
+
});
|
|
578
|
+
|
|
416
579
|
it('should ignore the order of fields (non-nested)', function () {
|
|
417
580
|
duplicatedPayload(
|
|
418
581
|
{
|
|
@@ -39,6 +39,31 @@ describe('#UrlAnalyzer', function () {
|
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
for (const [expectedType, examples] of Object.entries({
|
|
42
|
+
'search-gos': {
|
|
43
|
+
'https://scholar.google.com/scholar?hl=de&as_sdt=0,5&q=biontech+pennsylvania':
|
|
44
|
+
{
|
|
45
|
+
query: 'biontech pennsylvania',
|
|
46
|
+
doublefetchUrl:
|
|
47
|
+
'https://scholar.google.com/scholar?q=biontech+pennsylvania',
|
|
48
|
+
},
|
|
49
|
+
'https://scholar.google.de/scholar?hl=de&as_sdt=0%2C5&q=gauss-newton+algorithm&btnG=':
|
|
50
|
+
{
|
|
51
|
+
query: 'gauss-newton algorithm',
|
|
52
|
+
doublefetchUrl:
|
|
53
|
+
'https://scholar.google.de/scholar?q=gauss-newton+algorithm',
|
|
54
|
+
},
|
|
55
|
+
'https://scholar.google.de/scholar?hl=de&as_sdt=0%2C5&q=llm&btnG=':
|
|
56
|
+
{
|
|
57
|
+
query: 'llm',
|
|
58
|
+
doublefetchUrl: 'https://scholar.google.de/scholar?q=llm',
|
|
59
|
+
},
|
|
60
|
+
'https://scholar.google.de/scholar?hl=de&as_sdt=0%2C5&q=llm+mistral&btnG=':
|
|
61
|
+
{
|
|
62
|
+
query: 'llm mistral',
|
|
63
|
+
doublefetchUrl:
|
|
64
|
+
'https://scholar.google.de/scholar?q=llm+mistral',
|
|
65
|
+
},
|
|
66
|
+
},
|
|
42
67
|
'search-goi': {
|
|
43
68
|
'https://www.google.com/search?q=cat&sca_upv=1&hl=de&iflsig=ANes7DEAAAAAZhQcpulunO2PBVNfBmacf9LnDZWNgzgJ&uact=5&udm=2':
|
|
44
69
|
{
|