@whotracksme/reporting 5.1.17
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/.editorconfig +12 -0
- package/.eslintignore +3 -0
- package/.eslintrc +16 -0
- package/.github/workflows/release.yml +34 -0
- package/.github/workflows/tests.yml +20 -0
- package/.prettierrc +9 -0
- package/.tool-versions +1 -0
- package/CHANGELOG.md +795 -0
- package/LICENSE +373 -0
- package/README.md +1 -0
- package/communication/README.md +11 -0
- package/communication/example/index.js +43 -0
- package/communication/example/manifest.json +16 -0
- package/communication/karma.conf.cjs +19 -0
- package/communication/package.json +52 -0
- package/communication/rollup.common-config.cjs +17 -0
- package/communication/rollup.config.cjs +10 -0
- package/communication/src/encoding.js +54 -0
- package/communication/src/errors.js +84 -0
- package/communication/src/index.js +76 -0
- package/communication/src/logger.js +41 -0
- package/communication/src/padding.js +60 -0
- package/communication/src/proxied-http.js +231 -0
- package/communication/src/server-public-key-accessor.js +123 -0
- package/communication/src/timestamps.js +37 -0
- package/communication/src/trusted-clock.js +58 -0
- package/communication/src/utils.js +28 -0
- package/communication/src/zlib.js +17 -0
- package/communication/test/helpers/in-memory-database.js +43 -0
- package/communication/test/server-public-key-accessor.spec.js +135 -0
- package/communication/test/utils.spec.js +43 -0
- package/package.json +50 -0
- package/reporting/TODO.md +2 -0
- package/reporting/assets/request/bloom_filter.dat +0 -0
- package/reporting/assets/request/update.json +1 -0
- package/reporting/example/content.js +11 -0
- package/reporting/example/index.js +132 -0
- package/reporting/example/inspector/index.html +17 -0
- package/reporting/example/inspector/index.js +27 -0
- package/reporting/example/manifests/chromium.json +37 -0
- package/reporting/example/manifests/firefox.json +35 -0
- package/reporting/example/rules.json +62 -0
- package/reporting/example/setup.js +1 -0
- package/reporting/example/tests/test1.html +10 -0
- package/reporting/karma.conf.cjs +22 -0
- package/reporting/package.json +63 -0
- package/reporting/rollup.common-config.cjs +19 -0
- package/reporting/rollup.config.cjs +20 -0
- package/reporting/src/LRU.js +149 -0
- package/reporting/src/activity-estimator.js +298 -0
- package/reporting/src/alive-check.js +139 -0
- package/reporting/src/alive-message-generator.js +142 -0
- package/reporting/src/bloom-filters.js +345 -0
- package/reporting/src/country-provider.js +295 -0
- package/reporting/src/cyrb53.js +32 -0
- package/reporting/src/digest.js +33 -0
- package/reporting/src/doublefetch-page-handler.js +548 -0
- package/reporting/src/duplicate-detector.js +233 -0
- package/reporting/src/errors.js +84 -0
- package/reporting/src/event-listener-queue.js +121 -0
- package/reporting/src/fixed-size-cache.js +63 -0
- package/reporting/src/hash-detector.js +1526 -0
- package/reporting/src/html-parser.js +17 -0
- package/reporting/src/http.js +265 -0
- package/reporting/src/index.js +14 -0
- package/reporting/src/job-scheduler.js +912 -0
- package/reporting/src/logger.js +121 -0
- package/reporting/src/md5.js +334 -0
- package/reporting/src/message-sender.js +51 -0
- package/reporting/src/network.js +140 -0
- package/reporting/src/new-page-approver.js +119 -0
- package/reporting/src/page-aggregator.js +185 -0
- package/reporting/src/page-quorum-check-handler.js +200 -0
- package/reporting/src/page-structure.js +136 -0
- package/reporting/src/pagedb.js +671 -0
- package/reporting/src/pages.js +1798 -0
- package/reporting/src/patterns-updater.js +310 -0
- package/reporting/src/patterns.js +416 -0
- package/reporting/src/persisted-bitarray.js +265 -0
- package/reporting/src/persisted-hashes.js +189 -0
- package/reporting/src/quorum-checker.js +327 -0
- package/reporting/src/random.js +39 -0
- package/reporting/src/reporting.js +290 -0
- package/reporting/src/request/config.js +116 -0
- package/reporting/src/request/content-script.js +77 -0
- package/reporting/src/request/database.js +147 -0
- package/reporting/src/request/dnt.js +24 -0
- package/reporting/src/request/hash.js +101 -0
- package/reporting/src/request/index.js +874 -0
- package/reporting/src/request/page-telemetry.js +42 -0
- package/reporting/src/request/qs-whitelist2.js +247 -0
- package/reporting/src/request/resources/prob.js +601 -0
- package/reporting/src/request/steps/block-rules.js +40 -0
- package/reporting/src/request/steps/check-context.js +37 -0
- package/reporting/src/request/steps/cookie-context.js +209 -0
- package/reporting/src/request/steps/oauth-detector.js +101 -0
- package/reporting/src/request/steps/page-logger.js +177 -0
- package/reporting/src/request/steps/redirect-tagger.js +75 -0
- package/reporting/src/request/steps/subdomain-check.js +34 -0
- package/reporting/src/request/steps/token-checker/index.js +189 -0
- package/reporting/src/request/steps/token-checker/token-domain.js +129 -0
- package/reporting/src/request/steps/token-examiner.js +182 -0
- package/reporting/src/request/steps/token-telemetry/cached-entry-pipeline.js +210 -0
- package/reporting/src/request/steps/token-telemetry/index.js +234 -0
- package/reporting/src/request/steps/token-telemetry/key-pipeline.js +109 -0
- package/reporting/src/request/steps/token-telemetry/token-pipeline.js +105 -0
- package/reporting/src/request/time.js +73 -0
- package/reporting/src/request/utils/bloom-filter-packed.js +107 -0
- package/reporting/src/request/utils/chrome-storage-map.js +282 -0
- package/reporting/src/request/utils/subject.js +37 -0
- package/reporting/src/request/utils/temp-set.js +56 -0
- package/reporting/src/request/utils/tlds.js +55 -0
- package/reporting/src/request/utils.js +41 -0
- package/reporting/src/request-reporter.js +111 -0
- package/reporting/src/sanitizer.js +519 -0
- package/reporting/src/search-extractor.js +338 -0
- package/reporting/src/self-check.js +105 -0
- package/reporting/src/seq-executor.js +43 -0
- package/reporting/src/session-storage.js +399 -0
- package/reporting/src/url-analyzer.js +161 -0
- package/reporting/src/url-cleaner.js +60 -0
- package/reporting/src/utils/pacemaker.js +279 -0
- package/reporting/src/utils/url.js +114 -0
- package/reporting/src/utils.js +345 -0
- package/reporting/src/webrequest-pipeline/cname-uncloak.js +110 -0
- package/reporting/src/webrequest-pipeline/index.js +287 -0
- package/reporting/src/webrequest-pipeline/logger.js +14 -0
- package/reporting/src/webrequest-pipeline/page-store.js +282 -0
- package/reporting/src/webrequest-pipeline/page.js +140 -0
- package/reporting/src/webrequest-pipeline/pipeline.js +249 -0
- package/reporting/src/webrequest-pipeline/utils/webrequest.js +113 -0
- package/reporting/src/webrequest-pipeline/webrequest-context.js +153 -0
- package/reporting/test/README.md +2 -0
- package/reporting/test/activity-estimator.spec.js +356 -0
- package/reporting/test/alive-check.spec.js +156 -0
- package/reporting/test/alive-message-generator.spec.js +186 -0
- package/reporting/test/country-provider.spec.js +263 -0
- package/reporting/test/doublefetch-page-handler.spec.js +818 -0
- package/reporting/test/duplicate-detector.spec.js +689 -0
- package/reporting/test/helpers/dom-parsers.js +41 -0
- package/reporting/test/helpers/fake-session-storage.js +69 -0
- package/reporting/test/helpers/fast-check-utils.js +28 -0
- package/reporting/test/helpers/fetch-mock.js +57 -0
- package/reporting/test/helpers/in-memory-database.js +14 -0
- package/reporting/test/helpers/memory-map.js +72 -0
- package/reporting/test/helpers/pagedb-mocks.js +41 -0
- package/reporting/test/index.js +47 -0
- package/reporting/test/job-scheduler.spec.js +691 -0
- package/reporting/test/network.spec.js +72 -0
- package/reporting/test/page-aggregator.spec.js +104 -0
- package/reporting/test/page-quorum-check-handler.spec.js +86 -0
- package/reporting/test/pagedb.spec.js +250 -0
- package/reporting/test/pages.spec.js +693 -0
- package/reporting/test/patterns-updater.spec.js +446 -0
- package/reporting/test/patterns.spec.js +751 -0
- package/reporting/test/persisted-hashes.spec.js +169 -0
- package/reporting/test/reporting.spec.js +205 -0
- package/reporting/test/request/database.spec.js +59 -0
- package/reporting/test/request/hash.spec.js +108 -0
- package/reporting/test/request/index.spec.js +378 -0
- package/reporting/test/request/qs-whitelist2.spec.js +189 -0
- package/reporting/test/request/steps/check-context.spec.js +51 -0
- package/reporting/test/request/steps/oauth-detector.spec.js +339 -0
- package/reporting/test/request/test-pages.js +1246 -0
- package/reporting/test/request/utils/bloom-filter-packed.spec.js +37 -0
- package/reporting/test/request/utils/chrome-storage-map.spec.js +28 -0
- package/reporting/test/request/utils/tldts.spec.js +62 -0
- package/reporting/test/request/utils.spec.js +168 -0
- package/reporting/test/sanitizer.spec.js +1087 -0
- package/reporting/test/search-extractor.spec.js +590 -0
- package/reporting/test/seq-executor.spec.js +158 -0
- package/reporting/test/session-storage.spec.js +400 -0
- package/reporting/test/setup.js +24 -0
- package/reporting/test/url-analyzer.spec.js +451 -0
- package/reporting/test/url-cleaner.spec.js +102 -0
- package/reporting/test/utils/pacemaker.spec.js +222 -0
- package/reporting/test/utils/url.spec.js +660 -0
- package/reporting/test/utils.spec.js +299 -0
- package/reporting/test/webrequest-pipeline/pipeline.spec.js +251 -0
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WhoTracks.Me
|
|
3
|
+
* https://whotracks.me/
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2017-present Ghostery GmbH. All rights reserved.
|
|
6
|
+
*
|
|
7
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
8
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
9
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { expect } from 'chai';
|
|
13
|
+
import fc from 'fast-check';
|
|
14
|
+
|
|
15
|
+
import UrlAnalyzer from '../src/url-analyzer.js';
|
|
16
|
+
|
|
17
|
+
describe('#UrlAnalyzer', function () {
|
|
18
|
+
describe('with simple generic patterns', function () {
|
|
19
|
+
for (const [patternMode, modeDescription] of [
|
|
20
|
+
['all-supported', 'with server-side rules for all search engines'],
|
|
21
|
+
['all-unsupported', 'without server-side rules for any search engine'],
|
|
22
|
+
]) {
|
|
23
|
+
describe(modeDescription, function () {
|
|
24
|
+
let uut;
|
|
25
|
+
|
|
26
|
+
beforeEach(function () {
|
|
27
|
+
const patterns = {
|
|
28
|
+
createDoublefetchRequest(msgType, url) {
|
|
29
|
+
if (patternMode === 'all-supported') {
|
|
30
|
+
return { url };
|
|
31
|
+
}
|
|
32
|
+
if (patternMode === 'all-unsupported') {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
throw new Error('Illegal patternMode');
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
uut = new UrlAnalyzer(patterns);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
for (const [expectedType, examples] of Object.entries({
|
|
42
|
+
'search-goi': {
|
|
43
|
+
'https://www.google.com/search?q=cat&sca_upv=1&hl=de&iflsig=ANes7DEAAAAAZhQcpulunO2PBVNfBmacf9LnDZWNgzgJ&uact=5&udm=2':
|
|
44
|
+
{
|
|
45
|
+
query: 'cat',
|
|
46
|
+
doublefetchUrl: 'https://www.google.com/search?udm=2&q=cat',
|
|
47
|
+
},
|
|
48
|
+
'https://www.google.de/search?q=katze&hl=de&iflsig=ANes7DEAAAAAZhQcxZexib5tF0Ax5VRmScZNSAk8vwuf&uact=5&udm=2':
|
|
49
|
+
{
|
|
50
|
+
query: 'katze',
|
|
51
|
+
doublefetchUrl: 'https://www.google.de/search?udm=2&q=katze',
|
|
52
|
+
},
|
|
53
|
+
'https://www.google.co.uk/search?q=British+Shorthair&sca_upv=1&hl=de&iflsig=ANes7DEAAAAAZhQc4Y-TK94jMXG4FKSKMv6955MgSYqS&uact=5&udm=2':
|
|
54
|
+
{
|
|
55
|
+
query: 'British Shorthair',
|
|
56
|
+
doublefetchUrl:
|
|
57
|
+
'https://www.google.co.uk/search?udm=2&q=British+Shorthair',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
'search-gov': {
|
|
61
|
+
'https://www.google.com/search?q=cat&tbm=vid&ei=CWaMZMCpKMflkwWR3L_gCw&ved=0ahUKEwiA0uP_9Mf_AhXH8qQKHRHuD7wQ4dUDCAw&uact=5&oq=cat&gs_lcp=Cg1nd3Mtd2l6LXZpZGVvEAMyCwgAEIAEELEDEIMBMgsIABCABBCxAxCDATIHCAAQigUQQzILCAAQigUQsQMQgwEyBQgAEIAEMgUIABCABDILCAAQigUQsQMQgwEyBQgAEIAEMggIABCABBCxAzIICAAQgAQQsQM6CggAEIoFELEDEENQpQFY8gNg3ApoAHAAeACAAY8BiAGDA5IBAzMuMZgBAKABAcABAQ&sclient=gws-wiz-video':
|
|
62
|
+
{
|
|
63
|
+
query: 'cat',
|
|
64
|
+
doublefetchUrl: 'https://www.google.com/search?tbm=vid&q=cat',
|
|
65
|
+
},
|
|
66
|
+
'https://www.google.de/search?q=katze&tbm=vid&sa=X&ved=2ahUKEwi2xcvqgsj_AhWCcfEDHdmSBwwQ0pQJegQIBhAB&biw=1222&bih=976':
|
|
67
|
+
{
|
|
68
|
+
query: 'katze',
|
|
69
|
+
doublefetchUrl: 'https://www.google.de/search?tbm=vid&q=katze',
|
|
70
|
+
},
|
|
71
|
+
'https://www.google.co.uk/search?q=British+Shorthair&tbm=vid&sa=X&ved=2ahUKEwjalvf9gsj_AhXB6aQKHVJqBzIQ0pQJegQIChAB&biw=1222&bih=976':
|
|
72
|
+
{
|
|
73
|
+
query: 'British Shorthair',
|
|
74
|
+
doublefetchUrl:
|
|
75
|
+
'https://www.google.co.uk/search?tbm=vid&q=British+Shorthair',
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
'search-go': {
|
|
79
|
+
'https://www.google.com/search?q=eiffel+tower&source=hp&ei=qqCgY9uPNYOHxc8P65ic2AU&iflsig=AJiK0e8AAAAAY6CuukvNWgA7Z8DOk7aU5niFXq0FPyV_&ved=0ahUKEwjbjN3cm4b8AhWDQ_EDHWsMB1sQ4dUDCAs&uact=5&oq=eiffel+tower&gs_lcp=Cgdnd3Mtd2l6EAMyDgguEIAEELEDEMcBEK8BMgUIABCABDIFCAAQgAQyBQgAEIAEMgsILhCvARDHARCABDIFCAAQgAQyBQgAEIAEMgUIABCABDIFCC4QgAQyBQgAEIAEOhEILhCABBCxAxCDARDHARDRAzoLCAAQgAQQsQMQgwE6CAgAELEDEIMBOg4ILhCABBCxAxDHARDRAzoLCC4QgAQQxwEQ0QM6CAguELEDEIMBOggIABCABBCxAzoLCC4QsQMQgwEQ1AI6CwguEIAEELEDEIMBOg4ILhCvARDHARCxAxCABDoLCC4QgAQQsQMQ1AI6CwguEIAEEMcBEK8BOggILhCABBCxA1Cj4gFYhfUBYIr4AWgBcAB4AIABWIgBjAeSAQIxMpgBAKABAbABAA&sclient=gws-wiz':
|
|
80
|
+
{
|
|
81
|
+
query: 'eiffel tower',
|
|
82
|
+
doublefetchUrl: 'https://www.google.com/search?q=eiffel+tower',
|
|
83
|
+
},
|
|
84
|
+
'https://www.google.de/search?q=eiffelturm&source=hp&ei=4aCgY4-pKsj5kgWp4JrwCA&iflsig=AJiK0e8AAAAAY6Cu8Y3ud9bEicmzyHDM0uBYFatsxelY&ved=0ahUKEwjPne_2m4b8AhXIvKQKHSmwBo4Q4dUDCAo&uact=5&oq=eiffelturm&gs_lcp=Cgdnd3Mtd2l6EAMyDgguEK8BEMcBELEDEIAEMggIABCABBCxAzIICAAQgAQQsQMyCwgAEIAEELEDEIMBMgUIABCABDIFCAAQgAQyBQgAEIAEMggIABCABBCxAzIFCAAQgAQyBQgAEIAEOhEILhCABBCxAxCDARDHARDRAzoICAAQsQMQgwE6DgguEIAEELEDEMcBENEDOgsILhCABBDHARDRAzoICC4QsQMQgwE6CwguELEDEIMBENQCOgsILhCABBCxAxCDAToFCC4QgAQ6CwguEIAEELEDENQCOgsILhCABBDHARCvAToICC4QgAQQsQNQgQJY2BRg7RVoAnAAeACAAVaIAfsFkgECMTGYAQCgAQGwAQA&sclient=gws-wiz':
|
|
85
|
+
{
|
|
86
|
+
query: 'eiffelturm',
|
|
87
|
+
doublefetchUrl: 'https://www.google.de/search?q=eiffelturm',
|
|
88
|
+
},
|
|
89
|
+
'https://www.google.co.uk/search?q=big+ben&source=hp&ei=rAahY8WiMs6A9u8PwrWYwAY&iflsig=AJiK0e8AAAAAY6EUvMiuI7T8I426gYrRkT_KwUCXK7pJ&ved=0ahUKEwjFqOqA_Yb8AhVOgP0HHcIaBmgQ4dUDCAo&uact=5&oq=big+ben&gs_lcp=Cgdnd3Mtd2l6EAMyDgguEK8BEMcBELEDEIAEMgUIABCABDIFCAAQgAQyBQgAEIAEMgUIABCABDILCC4QrwEQxwEQgAQyBQgAEIAEMgUIABCABDIFCAAQgAQyCwguEIAEEMcBEK8BOgsIABCABBCxAxCDAToLCC4QgAQQsQMQ1AI6CAgAEIAEELEDOgsILhCABBDHARDRAzoICAAQsQMQgwE6EQguEK8BEMcBEJIDEMkDEIAEOhEILhCABBCxAxCDARDHARCvAToLCC4QgAQQsQMQgwE6DgguEIAEELEDEMcBEK8BOgcIABCxAxAKOhEILhCDARCvARDHARCxAxCABDoNCAAQgAQQsQMQgwEQClCkEljAHGDlHmgBcAB4AIABV4gBjASSAQE3mAEAoAEBsAEA&sclient=gws-wiz':
|
|
90
|
+
{
|
|
91
|
+
query: 'big ben',
|
|
92
|
+
doublefetchUrl: 'https://www.google.co.uk/search?q=big+ben',
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
'search-ya': {
|
|
96
|
+
'https://de.search.yahoo.com/search?p=katze&fr=yfp-t&fr2=p%3Afp%2Cm%3Asb&ei=UTF-8&fp=1':
|
|
97
|
+
{
|
|
98
|
+
query: 'katze',
|
|
99
|
+
doublefetchUrl: 'https://de.search.yahoo.com/search?q=katze',
|
|
100
|
+
},
|
|
101
|
+
'https://se.search.yahoo.com/search?p=lingon&fr=yfp-t&fr2=p%3Afp%2Cm%3Asb&ei=UTF-8&fp=1':
|
|
102
|
+
{
|
|
103
|
+
query: 'lingon',
|
|
104
|
+
doublefetchUrl: 'https://se.search.yahoo.com/search?q=lingon',
|
|
105
|
+
},
|
|
106
|
+
'https://se.search.yahoo.com/search?q=lingon': {
|
|
107
|
+
query: 'lingon',
|
|
108
|
+
doublefetchUrl: 'https://se.search.yahoo.com/search?q=lingon',
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
'search-bii': {
|
|
112
|
+
'https://www.bing.com/images/search?q=cat&form=HDRSC2&first=1&tsc=ImageHoverTitle':
|
|
113
|
+
{
|
|
114
|
+
query: 'cat',
|
|
115
|
+
doublefetchUrl: 'https://www.bing.com/images/search?q=cat',
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
'search-bi': {
|
|
119
|
+
'https://www.bing.com/search?q=eiffel+tower&search=&form=QBLH': {
|
|
120
|
+
query: 'eiffel tower',
|
|
121
|
+
doublefetchUrl: 'https://www.bing.com/search?q=eiffel+tower',
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
'search-am': {
|
|
125
|
+
'https://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=usb+stick':
|
|
126
|
+
{
|
|
127
|
+
query: 'usb stick',
|
|
128
|
+
doublefetchUrl:
|
|
129
|
+
'https://www.amazon.com/s/?field-keywords=usb+stick',
|
|
130
|
+
},
|
|
131
|
+
'https://www.amazon.com/s/?field-keywords=usb+stick': {
|
|
132
|
+
query: 'usb stick',
|
|
133
|
+
doublefetchUrl:
|
|
134
|
+
'https://www.amazon.com/s/?field-keywords=usb+stick',
|
|
135
|
+
},
|
|
136
|
+
'https://www.amazon.com/s?k=usb+stick&ref=nb_sb_noss': {
|
|
137
|
+
query: 'usb stick',
|
|
138
|
+
doublefetchUrl:
|
|
139
|
+
'https://www.amazon.com/s/?field-keywords=usb+stick',
|
|
140
|
+
},
|
|
141
|
+
'https://www.amazon.de/s/ref=nb_sb_noss?__mk_de_DE=%C3%85M%C3%85%C5%BD%C3%95%C3%91&url=search-alias%3Daps&field-keywords=usb+stick':
|
|
142
|
+
{
|
|
143
|
+
query: 'usb stick',
|
|
144
|
+
doublefetchUrl:
|
|
145
|
+
'https://www.amazon.de/s/?field-keywords=usb+stick',
|
|
146
|
+
},
|
|
147
|
+
'https://www.amazon.de/s/?field-keywords=usb+stick': {
|
|
148
|
+
query: 'usb stick',
|
|
149
|
+
doublefetchUrl:
|
|
150
|
+
'https://www.amazon.de/s/?field-keywords=usb+stick',
|
|
151
|
+
},
|
|
152
|
+
'https://www.amazon.de/s?k=usb+stick&ref=nb_sb_noss': {
|
|
153
|
+
query: 'usb stick',
|
|
154
|
+
doublefetchUrl:
|
|
155
|
+
'https://www.amazon.de/s/?field-keywords=usb+stick',
|
|
156
|
+
},
|
|
157
|
+
'https://www.amazon.de/s?k=usb+stick&link_code=qs&sourceid=Mozilla-search&tag=firefox-de-21':
|
|
158
|
+
{
|
|
159
|
+
query: 'usb stick',
|
|
160
|
+
doublefetchUrl:
|
|
161
|
+
'https://www.amazon.de/s/?field-keywords=usb+stick',
|
|
162
|
+
},
|
|
163
|
+
'https://www.amazon.fr/s/ref=nb_sb_noss?__mk_fr_FR=%C3%85M%C3%85%C5%BD%C3%95%C3%91&url=search-alias%3Daps&field-keywords=usb+stick':
|
|
164
|
+
{
|
|
165
|
+
query: 'usb stick',
|
|
166
|
+
doublefetchUrl:
|
|
167
|
+
'https://www.amazon.fr/s/?field-keywords=usb+stick',
|
|
168
|
+
},
|
|
169
|
+
'https://www.amazon.fr/s/?field-keywords=usb+stick': {
|
|
170
|
+
query: 'usb stick',
|
|
171
|
+
doublefetchUrl:
|
|
172
|
+
'https://www.amazon.fr/s/?field-keywords=usb+stick',
|
|
173
|
+
},
|
|
174
|
+
'https://www.amazon.fr/s?k=usb+stick&ref=nb_sb_noss': {
|
|
175
|
+
query: 'usb stick',
|
|
176
|
+
doublefetchUrl:
|
|
177
|
+
'https://www.amazon.fr/s/?field-keywords=usb+stick',
|
|
178
|
+
},
|
|
179
|
+
'https://www.amazon.co.uk/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=usb+stick':
|
|
180
|
+
{
|
|
181
|
+
query: 'usb stick',
|
|
182
|
+
doublefetchUrl:
|
|
183
|
+
'https://www.amazon.co.uk/s/?field-keywords=usb+stick',
|
|
184
|
+
},
|
|
185
|
+
'https://www.amazon.co.uk/s/?field-keywords=usb+stick': {
|
|
186
|
+
query: 'usb stick',
|
|
187
|
+
doublefetchUrl:
|
|
188
|
+
'https://www.amazon.co.uk/s/?field-keywords=usb+stick',
|
|
189
|
+
},
|
|
190
|
+
'https://www.amazon.co.uk/s?k=usb+stick&ref=nb_sb_noss': {
|
|
191
|
+
query: 'usb stick',
|
|
192
|
+
doublefetchUrl:
|
|
193
|
+
'https://www.amazon.co.uk/s/?field-keywords=usb+stick',
|
|
194
|
+
},
|
|
195
|
+
'https://www.amazon.co.uk/s?k=usb+stick&rh=n%3A430554031%2Cp_n_size_browse-bin%3A22433143031&dc&ds=v1%3AUkq7oU94vQBXuTjKsehQt6yIvm5lD8NEbMGVFKI3jOg&qid=1674079209&rnid=310771031&ref=sr_nr_p_n_size_browse-bin_8':
|
|
196
|
+
{
|
|
197
|
+
query: 'usb stick',
|
|
198
|
+
doublefetchUrl:
|
|
199
|
+
'https://www.amazon.co.uk/s/?field-keywords=usb+stick',
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
'search-dd': {
|
|
203
|
+
'https://duckduckgo.com/?q=eiffel+tower&t=h_&ia=web': {
|
|
204
|
+
query: 'eiffel tower',
|
|
205
|
+
doublefetchUrl: 'https://duckduckgo.com/?q=eiffel+tower',
|
|
206
|
+
},
|
|
207
|
+
'https://duckduckgo.com/?t=ffab&q=eiffel+tower&ia=web': {
|
|
208
|
+
query: 'eiffel tower',
|
|
209
|
+
doublefetchUrl: 'https://duckduckgo.com/?q=eiffel+tower',
|
|
210
|
+
},
|
|
211
|
+
'https://duckduckgo.com/?q=eiffel+tower': {
|
|
212
|
+
query: 'eiffel tower',
|
|
213
|
+
doublefetchUrl: 'https://duckduckgo.com/?q=eiffel+tower',
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
})) {
|
|
217
|
+
describe(`and examples for category: ${expectedType}`, function () {
|
|
218
|
+
for (const [
|
|
219
|
+
url,
|
|
220
|
+
{ query: expectedQuery, doublefetchUrl },
|
|
221
|
+
] of Object.entries(examples)) {
|
|
222
|
+
it(`should match ${url}`, function () {
|
|
223
|
+
const { isSupported, category, query, doublefetchRequest } =
|
|
224
|
+
uut.parseSearchLinks(url);
|
|
225
|
+
|
|
226
|
+
// since it matches, it should always detect the category and query ...
|
|
227
|
+
expect(category).to.eql(expectedType);
|
|
228
|
+
expect(query).to.eql(expectedQuery);
|
|
229
|
+
|
|
230
|
+
// ... but whether it is supported depends on the test setup
|
|
231
|
+
if (patternMode === 'all-supported') {
|
|
232
|
+
expect(isSupported).to.be.true;
|
|
233
|
+
expect(doublefetchRequest.url).to.eql(doublefetchUrl);
|
|
234
|
+
} else if (patternMode === 'all-unsupported') {
|
|
235
|
+
expect(isSupported).to.be.false;
|
|
236
|
+
expect(doublefetchRequest).to.be.undefined;
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
describe('and examples for URLs that should not match', function () {
|
|
244
|
+
for (const url of [
|
|
245
|
+
'https://example.com/',
|
|
246
|
+
'http://127.0.0.1:8080/',
|
|
247
|
+
'http://fritz.box/',
|
|
248
|
+
'https://www.ghostery.com/blog',
|
|
249
|
+
'https://store.google.com/DE/?utm_source=hp_header&utm_medium=google_ooo&utm_campaign=GS100042&hl=de-DE',
|
|
250
|
+
'https://accounts.google.com/v3/signin/identifier?dsh=S788983809%3A1671471756806523&continue=https%3A%2F%2Fwww.google.com%2F&ec=GAZAmgQ&hl=de&passive=true&flowName=GlifWebSignIn&flowEntry=ServiceLogin&ifkv=AeAAQh45t5f0ZbYt-xWR7sB1PXU0thVRp5kcqclfTVoP24W7gXKVxWVXvWbzo-yUMs7LIMkaCYUepg',
|
|
251
|
+
'https://www.amazon.com/ap/signin?openid.pape.max_auth_age=0&openid.return_to=https%3A%2F%2Fwww.amazon.com%2Fs%2Fref%3Dnb_sb_noss%2F%3F_encoding%3DUTF8%26field-keywords%3Dusb%2520stick%26url%3Dsearch-alias%253Daps%26ref_%3Dnav_ya_signin&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.assoc_handle=usflex&openid.mode=checkid_setup&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&',
|
|
252
|
+
'https://www.amazon.com/SanDisk-Ultra-Flair-128GB-Flash/dp/B015CH1PJU/ref=sr_1_3?keywords=usb+stick&qid=1674077012&sr=8-3',
|
|
253
|
+
'https://www.amazon.com/gp/aws/cart/add.html?ASIN.1=B0752BLWNB&Quantity.1=1',
|
|
254
|
+
'https://www.amazon.com/gp/aws/cart/add.html?ASIN.1=B00SUZWGHM&Quantity.1=1&ASIN.2=B00809ERAM&Quantity.2=1',
|
|
255
|
+
'https://duckduckgo.com/?t=ffab&q=eiffel+tower&iax=images&ia=images',
|
|
256
|
+
'https://duckduckgo.com/?t=ffab&q=eiffel+tower&iax=videos&ia=videos',
|
|
257
|
+
'https://duckduckgo.com/?t=ffab&q=eiffel+tower&iar=news&ia=news',
|
|
258
|
+
'https://duckduckgo.com/?t=ffab&q=eiffel+tower&ia=news&iaxm=about',
|
|
259
|
+
]) {
|
|
260
|
+
it(`should not match ${url}`, function () {
|
|
261
|
+
const { isSupported, category, query } =
|
|
262
|
+
uut.parseSearchLinks(url);
|
|
263
|
+
expect(isSupported).to.be.false;
|
|
264
|
+
expect(category).to.be.undefined;
|
|
265
|
+
expect(query).to.be.undefined;
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
describe('with fake patterns for search-go', function () {
|
|
274
|
+
const nonGoogleExamples = {
|
|
275
|
+
'search-bi': {
|
|
276
|
+
'https://www.bing.com/search?q=eiffel+tower&search=&form=QBLH':
|
|
277
|
+
'eiffel tower',
|
|
278
|
+
},
|
|
279
|
+
'search-am': {
|
|
280
|
+
'https://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=usb+stick':
|
|
281
|
+
'usb stick',
|
|
282
|
+
},
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
function searchGoDoublefetch(url) {
|
|
286
|
+
return {
|
|
287
|
+
url,
|
|
288
|
+
redirect: 'follow',
|
|
289
|
+
headers: {
|
|
290
|
+
Cookie: 'SOME_DUMMY_VALUE',
|
|
291
|
+
},
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function searchGoFakePatterns() {
|
|
296
|
+
return {
|
|
297
|
+
createDoublefetchRequest(msgType, url) {
|
|
298
|
+
if (msgType === 'search-go') {
|
|
299
|
+
return searchGoDoublefetch(url);
|
|
300
|
+
}
|
|
301
|
+
if (nonGoogleExamples[msgType]) {
|
|
302
|
+
return undefined;
|
|
303
|
+
}
|
|
304
|
+
throw new Error(`Unexpected msgType: ${msgType}`);
|
|
305
|
+
},
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
let uut;
|
|
310
|
+
|
|
311
|
+
beforeEach(function () {
|
|
312
|
+
const patterns = searchGoFakePatterns();
|
|
313
|
+
uut = new UrlAnalyzer(patterns);
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
it('should detect the query "trump alaska"', function () {
|
|
317
|
+
const url =
|
|
318
|
+
'https://www.google.de/search?source=hp&ei=c1tmXYGgDsXGkwXak4z4BQ&q=trump+alaska&oq=trump+alaska&gs_l=psy-ab.3..0i324j0i3j0i22i30l8.4708.6506..6817...0.0..0.476.1834.2j5j1j1j1......0....1..gws-wiz.......0i131j0.tK4mGhzYgHg&ved=0ahUKEwjBpazHsaXkAhVF46QKHdoJA18Q4dUDCAc&uact=5';
|
|
319
|
+
expect(uut.parseSearchLinks(url)).to.eql({
|
|
320
|
+
isSupported: true,
|
|
321
|
+
category: 'search-go',
|
|
322
|
+
query: 'trump alaska',
|
|
323
|
+
doublefetchRequest: searchGoDoublefetch(
|
|
324
|
+
'https://www.google.de/search?q=trump+alaska',
|
|
325
|
+
),
|
|
326
|
+
});
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
it('should detect query with "+" sign: "a+b"', function () {
|
|
330
|
+
const url =
|
|
331
|
+
'https://www.google.com/search?q=a%2Bb&oq=a%2Bb&aqs=chrome..69i57j0l5.9078j0j8&sourceid=chrome&ie=UTF-8#sbfbu=1&pi=a%2Bb';
|
|
332
|
+
expect(uut.parseSearchLinks(url)).to.eql({
|
|
333
|
+
isSupported: true,
|
|
334
|
+
category: 'search-go',
|
|
335
|
+
query: 'a+b',
|
|
336
|
+
doublefetchRequest: searchGoDoublefetch(
|
|
337
|
+
'https://www.google.com/search?q=a%2Bb',
|
|
338
|
+
),
|
|
339
|
+
});
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
it('should detect query with "#" sign: "c# how to read a file"', function () {
|
|
343
|
+
const url =
|
|
344
|
+
'https://www.google.com/search?q=c%23+how+to+read+a+file&oq=c%23+how+to+read+a+file&aqs=chrome..69i57j69i58.7270j0j7&sourceid=chrome&ie=UTF-8';
|
|
345
|
+
expect(uut.parseSearchLinks(url)).to.eql({
|
|
346
|
+
isSupported: true,
|
|
347
|
+
category: 'search-go',
|
|
348
|
+
query: 'c# how to read a file',
|
|
349
|
+
doublefetchRequest: searchGoDoublefetch(
|
|
350
|
+
'https://www.google.com/search?q=c%23+how+to+read+a+file',
|
|
351
|
+
),
|
|
352
|
+
});
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
it('should detect query with more special characters', function () {
|
|
356
|
+
const url =
|
|
357
|
+
'https://www.google.com/search?q=a%2Bb&oq=a%2Bb&aqs=chrome..69i57j0l5.9078j0j8&sourceid=chrome&ie=UTF-8#sbfbu=1&pi=a%2Bb';
|
|
358
|
+
expect(uut.parseSearchLinks(url)).to.eql({
|
|
359
|
+
isSupported: true,
|
|
360
|
+
category: 'search-go',
|
|
361
|
+
query: 'a+b',
|
|
362
|
+
doublefetchRequest: searchGoDoublefetch(
|
|
363
|
+
'https://www.google.com/search?q=a%2Bb',
|
|
364
|
+
),
|
|
365
|
+
});
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
it('should support queries from auto-completion ("magnus ca" -> "magnus carlsen")', function () {
|
|
369
|
+
const url =
|
|
370
|
+
'https://www.google.com/search?q=magnus+carlsen&source=hp&oq=magnus+ca&gs_l=mobile-heirloom-hp.1.1.41j0i512i433i131l2j0i3l2.3398.7907.0.12670.10.8.0.2.2.0.250.1118.1j6j1.8.0....0...1c.1.34.mobile-heirloom-hp..0.10.1209.82wOg7b9tFw';
|
|
371
|
+
expect(uut.parseSearchLinks(url)).to.eql({
|
|
372
|
+
isSupported: true,
|
|
373
|
+
category: 'search-go',
|
|
374
|
+
query: 'magnus carlsen',
|
|
375
|
+
doublefetchRequest: searchGoDoublefetch(
|
|
376
|
+
'https://www.google.com/search?q=magnus+carlsen',
|
|
377
|
+
),
|
|
378
|
+
});
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
it('should not find term queries on non-search pages (no false-positives)', function () {
|
|
382
|
+
const urls = [
|
|
383
|
+
'https://cliqz.com/',
|
|
384
|
+
'about:config',
|
|
385
|
+
'http://127.0.0.1:8080/foo/bar',
|
|
386
|
+
'https://www.google.de/',
|
|
387
|
+
'https://www.google.com/intl/de/gmail/about/',
|
|
388
|
+
];
|
|
389
|
+
|
|
390
|
+
for (const url of urls) {
|
|
391
|
+
expect(uut.parseSearchLinks(url)).to.eql({ isSupported: false });
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
|
|
395
|
+
it('should support special characters (ascii)', function () {
|
|
396
|
+
fc.assert(
|
|
397
|
+
fc.property(fc.string(), (text) => {
|
|
398
|
+
fc.pre(text.length > 0 && text === text.trim());
|
|
399
|
+
const encodedText = encodeURIComponent(text);
|
|
400
|
+
const url = `https://www.google.com/search?q=${encodedText}`;
|
|
401
|
+
|
|
402
|
+
const { query } = uut.parseSearchLinks(url);
|
|
403
|
+
return query === text;
|
|
404
|
+
}),
|
|
405
|
+
);
|
|
406
|
+
});
|
|
407
|
+
|
|
408
|
+
it('should support special characters (unicode)', function () {
|
|
409
|
+
fc.assert(
|
|
410
|
+
fc.property(fc.fullUnicodeString(), (text) => {
|
|
411
|
+
fc.pre(text.length > 0 && text === text.trim());
|
|
412
|
+
const encodedText = encodeURIComponent(text);
|
|
413
|
+
const url = `https://www.google.com/search?q=${encodedText}`;
|
|
414
|
+
|
|
415
|
+
const { query } = uut.parseSearchLinks(url);
|
|
416
|
+
return query === text;
|
|
417
|
+
}),
|
|
418
|
+
);
|
|
419
|
+
});
|
|
420
|
+
|
|
421
|
+
it('should handle all kind of URLs without throwing an exception', function () {
|
|
422
|
+
fc.assert(
|
|
423
|
+
fc.property(fc.webUrl(), (url) => {
|
|
424
|
+
// should not throw
|
|
425
|
+
uut.parseSearchLinks(url);
|
|
426
|
+
}),
|
|
427
|
+
);
|
|
428
|
+
});
|
|
429
|
+
|
|
430
|
+
// In the test setup, only Google is supported. Verify that the other
|
|
431
|
+
// engines are partly matched but are not supported (no doublefetch).
|
|
432
|
+
describe('should detect but not support a non-configured search engine', function () {
|
|
433
|
+
for (const [expectedType, examples] of Object.entries(
|
|
434
|
+
nonGoogleExamples,
|
|
435
|
+
)) {
|
|
436
|
+
describe(`and examples for category: ${expectedType}`, function () {
|
|
437
|
+
for (const [url, expectedQuery] of Object.entries(examples)) {
|
|
438
|
+
it(`should match ${url}`, function () {
|
|
439
|
+
const { isSupported, category, query, doublefetchRequest } =
|
|
440
|
+
uut.parseSearchLinks(url);
|
|
441
|
+
expect(isSupported).to.be.false;
|
|
442
|
+
expect(category).to.eql(expectedType);
|
|
443
|
+
expect(query).to.eql(expectedQuery);
|
|
444
|
+
expect(doublefetchRequest).to.be.undefined;
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
});
|
|
451
|
+
});
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WhoTracks.Me
|
|
3
|
+
* https://whotracks.me/
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2017-present Ghostery GmbH. All rights reserved.
|
|
6
|
+
*
|
|
7
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
8
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
9
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { expect } from 'chai';
|
|
13
|
+
|
|
14
|
+
import { removeQueryParams, removeSearchHash } from '../src/url-cleaner.js';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Note: this function is also used to implement the "removeParams" builtin.
|
|
18
|
+
* The builtin tests (see ../test/patters.spec.js) operate under a stronger
|
|
19
|
+
* precondition (assuming valid, absolute URL). No need to replicate these
|
|
20
|
+
* tests here again.
|
|
21
|
+
*/
|
|
22
|
+
describe('#removeQueryParams', function () {
|
|
23
|
+
describe('when used with valid URLs where URL.canParse(url) is true', function () {
|
|
24
|
+
it('should work in a simple example', function () {
|
|
25
|
+
expect(
|
|
26
|
+
removeQueryParams('https://example.test/path?foo=1&bar=2#baz', ['foo']),
|
|
27
|
+
).to.eql('https://example.test/path?bar=2#baz');
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
describe('should handle non-valid URLs gracefully', function () {
|
|
32
|
+
it('should support relative URLs', function () {
|
|
33
|
+
expect(removeQueryParams('/relative?foo=1&bar=2#baz', ['foo'])).to.eql(
|
|
34
|
+
'/relative?bar=2#baz',
|
|
35
|
+
);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
describe('should support incomplete URLs', function () {
|
|
39
|
+
it('with missing /', function () {
|
|
40
|
+
expect(removeQueryParams('https://example.test', ['foo'])).to.eql(
|
|
41
|
+
'https://example.test',
|
|
42
|
+
);
|
|
43
|
+
expect(
|
|
44
|
+
removeQueryParams('https://example.test?foo=bar', ['foo']),
|
|
45
|
+
).to.eql('https://example.test');
|
|
46
|
+
expect(
|
|
47
|
+
removeQueryParams('https://example.test?foo=bar#abc', ['foo']),
|
|
48
|
+
).to.eql('https://example.test#abc');
|
|
49
|
+
expect(removeQueryParams('https://example.test#abc', ['foo'])).to.eql(
|
|
50
|
+
'https://example.test#abc',
|
|
51
|
+
);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('with missing /', function () {
|
|
55
|
+
expect(removeQueryParams('//example.test', ['foo'])).to.eql(
|
|
56
|
+
'//example.test',
|
|
57
|
+
);
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
describe('#removeSearchHash', function () {
|
|
64
|
+
it('should work in the happy path', function () {
|
|
65
|
+
expect(removeSearchHash('https://example.test/foo#')).to.eql(
|
|
66
|
+
'https://example.test/foo',
|
|
67
|
+
);
|
|
68
|
+
expect(removeSearchHash('https://example.test/foo#remove-me')).to.eql(
|
|
69
|
+
'https://example.test/foo',
|
|
70
|
+
);
|
|
71
|
+
expect(removeSearchHash('https://example.test/foo?x=y#')).to.eql(
|
|
72
|
+
'https://example.test/foo?x=y',
|
|
73
|
+
);
|
|
74
|
+
expect(removeSearchHash('https://example.test/foo?x=y#remove-me')).to.eql(
|
|
75
|
+
'https://example.test/foo?x=y',
|
|
76
|
+
);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('should not change URLs without hashes', function () {
|
|
80
|
+
expect(removeSearchHash('https://example.test/foo')).to.eql(
|
|
81
|
+
'https://example.test/foo',
|
|
82
|
+
);
|
|
83
|
+
expect(removeSearchHash('https://example.test/foo?x=y')).to.eql(
|
|
84
|
+
'https://example.test/foo?x=y',
|
|
85
|
+
);
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it('should work with multiple hashes', function () {
|
|
89
|
+
expect(removeSearchHash('https://example.test/foo#remove#me')).to.eql(
|
|
90
|
+
'https://example.test/foo',
|
|
91
|
+
);
|
|
92
|
+
expect(removeSearchHash('https://example.test/foo##remove#me')).to.eql(
|
|
93
|
+
'https://example.test/foo',
|
|
94
|
+
);
|
|
95
|
+
expect(removeSearchHash('https://example.test/foo##')).to.eql(
|
|
96
|
+
'https://example.test/foo',
|
|
97
|
+
);
|
|
98
|
+
expect(removeSearchHash('https://example.test/foo#remove#me#')).to.eql(
|
|
99
|
+
'https://example.test/foo',
|
|
100
|
+
);
|
|
101
|
+
});
|
|
102
|
+
});
|