@whotracksme/reporting 12.1.8 β 12.1.9
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,15 @@
|
|
|
1
|
+
# v12.1.9 (Wed Nov 18 2026)
|
|
2
|
+
|
|
3
|
+
#### π Bug Fix
|
|
4
|
+
|
|
5
|
+
- fix: a page that was marked as private is accepted again (wrong key in the lookup) [#251](https://github.com/whotracksme/webextension-packages/pull/251) ([@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
|
+
|
|
1
13
|
# v12.1.8 (Wed Nov 18 2026)
|
|
2
14
|
|
|
3
15
|
#### π Bug Fix
|
package/package.json
CHANGED
|
@@ -56,7 +56,7 @@ export default class NewPageApprover {
|
|
|
56
56
|
if (await this.persistedHashes.has(hash)) {
|
|
57
57
|
return reject('end of cooldown not reached yet');
|
|
58
58
|
}
|
|
59
|
-
if (await this.
|
|
59
|
+
if (await this.mightBeMarkedAsPrivate(url)) {
|
|
60
60
|
return reject('page has been (possibly) marked as private before');
|
|
61
61
|
}
|
|
62
62
|
|
package/reporting/test/index.js
CHANGED
|
@@ -16,6 +16,7 @@ import './url-analyzer.spec.js';
|
|
|
16
16
|
import './alive-check.spec.js';
|
|
17
17
|
import './alive-message-generator.spec.js';
|
|
18
18
|
import './nav-tracking-detector.spec.js';
|
|
19
|
+
import './new-page-approver.spec.js';
|
|
19
20
|
import './network.spec.js';
|
|
20
21
|
import './observable.spec.js';
|
|
21
22
|
import './pagedb.spec.js';
|
|
@@ -0,0 +1,66 @@
|
|
|
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 { BloomFilter } from '../src/bloom-filters.js';
|
|
15
|
+
import NewPageApprover from '../src/new-page-approver.js';
|
|
16
|
+
import InMemoryDatabase from './helpers/in-memory-database.js';
|
|
17
|
+
import { createInMemoryPersistedHashes } from './helpers/in-memory-persisted-hashes.js';
|
|
18
|
+
|
|
19
|
+
describe('#NewPageApprover', function () {
|
|
20
|
+
const url = 'https://example.test/foo';
|
|
21
|
+
let uut;
|
|
22
|
+
|
|
23
|
+
beforeEach(function () {
|
|
24
|
+
const privatePageBloomFilter = new BloomFilter({
|
|
25
|
+
database: new InMemoryDatabase(),
|
|
26
|
+
name: 'test',
|
|
27
|
+
partitions: [1009, 1013, 1019],
|
|
28
|
+
});
|
|
29
|
+
uut = new NewPageApprover(
|
|
30
|
+
createInMemoryPersistedHashes(),
|
|
31
|
+
privatePageBloomFilter,
|
|
32
|
+
);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
describe('#allowCreation', function () {
|
|
36
|
+
it('should accept a new page', async function () {
|
|
37
|
+
expect(await uut.allowCreation(url)).to.eql({ ok: true });
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('should reject a page until the end of its cooldown', async function () {
|
|
41
|
+
expect(await uut.allowCreation(url)).to.eql({ ok: true });
|
|
42
|
+
expect((await uut.allowCreation(url)).ok).to.eql(false);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('should reject a page that was marked as private', async function () {
|
|
46
|
+
await uut.markAsPrivate(url);
|
|
47
|
+
expect((await uut.allowCreation(url)).ok).to.eql(false);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('should not start the cooldown for a page that was marked as private', async function () {
|
|
51
|
+
await uut.markAsPrivate(url);
|
|
52
|
+
await uut.allowCreation(url);
|
|
53
|
+
expect(uut.persistedHashes.entries.size).to.eql(0);
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
describe('#mightBeMarkedAsPrivate', function () {
|
|
58
|
+
it('should find only pages that were marked as private', async function () {
|
|
59
|
+
expect(await uut.mightBeMarkedAsPrivate(url)).to.eql(false);
|
|
60
|
+
|
|
61
|
+
await uut.markAsPrivate(url);
|
|
62
|
+
expect(await uut.mightBeMarkedAsPrivate(url)).to.eql(true);
|
|
63
|
+
expect(await uut.mightBeMarkedAsPrivate(`${url}/bar`)).to.eql(false);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
});
|