@whotracksme/reporting 12.1.8 → 12.1.10
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.10 (Wed Nov 18 2026)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- fix: PageDB does not update pages in tabs that are not active [#252](https://github.com/whotracksme/webextension-packages/pull/252) ([@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.9 (Wed Nov 18 2026)
|
|
14
|
+
|
|
15
|
+
#### 🐛 Bug Fix
|
|
16
|
+
|
|
17
|
+
- 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))
|
|
18
|
+
|
|
19
|
+
#### Authors: 1
|
|
20
|
+
|
|
21
|
+
- Philipp Claßen ([@philipp-classen](https://github.com/philipp-classen))
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
1
25
|
# v12.1.8 (Wed Nov 18 2026)
|
|
2
26
|
|
|
3
27
|
#### 🐛 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/src/pagedb.js
CHANGED
|
@@ -263,7 +263,7 @@ export default class PageDB {
|
|
|
263
263
|
const shouldUpdate =
|
|
264
264
|
url == activeUrl ||
|
|
265
265
|
(inMemoryEntry !== null &&
|
|
266
|
-
pages.some((x) => x.lastUpdatedAt
|
|
266
|
+
pages.some((x) => x.lastUpdatedAt > inMemoryEntry.lastUpdatedAt));
|
|
267
267
|
if (shouldUpdate) {
|
|
268
268
|
const updateDB = (oldEntry) => {
|
|
269
269
|
const page = mergePages([oldEntry, ...pages]);
|
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
|
+
});
|
|
@@ -172,6 +172,49 @@ describe('#PageDB', function () {
|
|
|
172
172
|
await expectUrlsInMemory([page.url]);
|
|
173
173
|
await expectUrlsInDb([page.url]);
|
|
174
174
|
});
|
|
175
|
+
|
|
176
|
+
describe('for a page in a non-active tab that is already known', function () {
|
|
177
|
+
function loadingPage() {
|
|
178
|
+
const page = { ...somePage(), status: 'loading' };
|
|
179
|
+
delete page.preDoublefetch;
|
|
180
|
+
return page;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
async function pageInMemory(url) {
|
|
184
|
+
const { memory } = await uut.describeState({ inMemoryOnly: true });
|
|
185
|
+
return memory[url];
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
it('should take over newer information', async function () {
|
|
189
|
+
const before = loadingPage();
|
|
190
|
+
await uut.updatePages([before], undefined);
|
|
191
|
+
|
|
192
|
+
const after = {
|
|
193
|
+
...somePage(),
|
|
194
|
+
lastUpdatedAt: before.lastUpdatedAt + 1,
|
|
195
|
+
};
|
|
196
|
+
await uut.updatePages([after], undefined);
|
|
197
|
+
|
|
198
|
+
const page = await pageInMemory(after.url);
|
|
199
|
+
expect(page.status).to.eql('complete');
|
|
200
|
+
expect(page.preDoublefetch).to.eql(after.preDoublefetch);
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
it('should ignore older information', async function () {
|
|
204
|
+
const before = somePage();
|
|
205
|
+
await uut.updatePages([before], undefined);
|
|
206
|
+
|
|
207
|
+
const after = {
|
|
208
|
+
...loadingPage(),
|
|
209
|
+
lastUpdatedAt: before.lastUpdatedAt - 1,
|
|
210
|
+
};
|
|
211
|
+
await uut.updatePages([after], undefined);
|
|
212
|
+
|
|
213
|
+
const page = await pageInMemory(before.url);
|
|
214
|
+
expect(page.status).to.eql('complete');
|
|
215
|
+
expect(page.preDoublefetch).to.eql(before.preDoublefetch);
|
|
216
|
+
});
|
|
217
|
+
});
|
|
175
218
|
});
|
|
176
219
|
|
|
177
220
|
describe('#acquireExpiredPages', function () {
|