@whotracksme/reporting 12.1.10 β†’ 12.1.11

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.11 (Wed Nov 18 2026)
2
+
3
+ #### πŸ› Bug Fix
4
+
5
+ - fix: PageAggregator listens for an event name that does not exist [#253](https://github.com/whotracksme/webextension-packages/pull/253) ([@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.10 (Wed Nov 18 2026)
2
14
 
3
15
  #### πŸ› Bug Fix
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whotracksme/reporting",
3
- "version": "12.1.10",
3
+ "version": "12.1.11",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./sanitizer": "./reporting/src/sanitizer.js",
@@ -53,7 +53,7 @@ export default class PageAggregator {
53
53
  } else {
54
54
  this.syncTab(event.tabId);
55
55
  }
56
- } else if (event.type === 'search-landing') {
56
+ } else if (event.type === 'safe-search-landing') {
57
57
  this.syncTab(event.tabId);
58
58
  } else if (event.type === 'activity-updated') {
59
59
  const { urls, activityEstimator } = event;
@@ -103,5 +103,44 @@ describe('#PageAggregator', function () {
103
103
  uut.fullSync();
104
104
  await clock.runAllAsync();
105
105
  });
106
+
107
+ describe('#onPageEvent', function () {
108
+ const tabId = 42;
109
+ const landingPage = {
110
+ status: 'complete',
111
+ title: 'Some landing page',
112
+ url: 'https://www.example.test/landing',
113
+ search: { category: 'go', query: 'some query', depth: 1 },
114
+ lastUpdatedAt: 1577836800000,
115
+ };
116
+
117
+ async function pagesInDb() {
118
+ await clock.runAllAsync();
119
+ const { memory } = await pagedb.describeState({ inMemoryOnly: true });
120
+ return memory;
121
+ }
122
+
123
+ beforeEach(function () {
124
+ pages.describeTab = (id) => (id === tabId ? landingPage : null);
125
+ });
126
+
127
+ it('should sync the tab when the user lands on a search result', async function () {
128
+ uut.onPageEvent({ type: 'safe-search-landing', tabId, details: {} });
129
+
130
+ const memory = await pagesInDb();
131
+ expect(Object.keys(memory)).to.eql([landingPage.url]);
132
+ expect(memory[landingPage.url].search).to.eql(landingPage.search);
133
+ });
134
+
135
+ it('should ignore other navigation events', async function () {
136
+ uut.onPageEvent({
137
+ type: 'safe-page-navigation',
138
+ tabId,
139
+ url: landingPage.url,
140
+ });
141
+
142
+ expect(await pagesInDb()).to.eql({});
143
+ });
144
+ });
106
145
  });
107
146
  });