@whotracksme/reporting 7.7.0 → 7.7.1

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
+ # v7.7.1 (Mon Sep 15 2025)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - Fix: offscreen window size attributes [#167](https://github.com/whotracksme/webextension-packages/pull/167) ([@chrmod](https://github.com/chrmod))
6
+
7
+ #### Authors: 1
8
+
9
+ - Krzysztof Modras ([@chrmod](https://github.com/chrmod))
10
+
11
+ ---
12
+
1
13
  # v7.7.0 (Tue Aug 26 2025)
2
14
 
3
15
  #### 🚀 Enhancement
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whotracksme/reporting",
3
- "version": "7.7.0",
3
+ "version": "7.7.1",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "scripts": {
@@ -29,6 +29,7 @@ module.exports = [
29
29
  copy({
30
30
  targets: [
31
31
  { src: 'src/offscreen/doublefetch/index.html', dest: 'example/offscreen/doublefetch/' },
32
+ { src: 'src/offscreen/doublefetch/offscreen-fix.js', dest: 'example/offscreen/doublefetch/' },
32
33
  ]
33
34
  })
34
35
  ]
@@ -309,8 +309,8 @@ async function tryCloseOffscreenDocument() {
309
309
  }
310
310
  }
311
311
  }
312
-
313
- const OFFSCREEN_DOCUMENT_PATH = 'offscreen/doublefetch/index.html';
312
+ const OFFSCREEN_DOCUMENT_PREFIX = 'offscreen/doublefetch';
313
+ const OFFSCREEN_DOCUMENT_PATH = `${OFFSCREEN_DOCUMENT_PREFIX}/index.html`;
314
314
 
315
315
  async function withOffscreenDocumentReady(url, headers, asyncCallback) {
316
316
  const cleanups = [];
@@ -335,6 +335,29 @@ async function withOffscreenDocumentReady(url, headers, asyncCallback) {
335
335
  const undoDNRChange = await addDNRSessionRule(rule);
336
336
  cleanups.push(undoDNRChange);
337
337
 
338
+ await chrome.scripting.registerContentScripts([
339
+ {
340
+ id: 'offscreen-fix',
341
+ matches: [`https://*.${domain}/*`, `https://${domain}/*`],
342
+ js: [`${OFFSCREEN_DOCUMENT_PREFIX}/offscreen-fix.js`],
343
+ runAt: 'document_start',
344
+ allFrames: true,
345
+ world: 'MAIN',
346
+ },
347
+ ]);
348
+ cleanups.push(() => {
349
+ chrome.scripting
350
+ .unregisterContentScripts({
351
+ ids: ['offscreen-fix'],
352
+ })
353
+ .catch((e) => {
354
+ logger.error(
355
+ 'cleanup failed: unable to remove offscreen content script:',
356
+ e,
357
+ );
358
+ });
359
+ });
360
+
338
361
  const undoHeaderOverride = await headerOverride({
339
362
  headers,
340
363
  url,
@@ -0,0 +1,13 @@
1
+ if (window.outerWidth === 0) {
2
+ Object.defineProperty(window, 'outerWidth', {
3
+ get: () => 1920,
4
+ configurable: true,
5
+ });
6
+ }
7
+
8
+ if (window.outerHeight === 0) {
9
+ Object.defineProperty(window, 'outerHeight', {
10
+ get: () => 1080,
11
+ configurable: true,
12
+ });
13
+ }