Skip to content

Commit 5989407

Browse files
Release build 4.20.0 [ci release]
1 parent 4e56a8a commit 5989407

File tree

12 files changed

+126
-524
lines changed

12 files changed

+126
-524
lines changed

Sources/ContentScopeScripts/dist/contentScope.js

Lines changed: 4 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,8 @@
22
(function () {
33
'use strict';
44

5-
/* global false */
6-
7-
let dummyWindow;
8-
if ('document' in globalThis &&
9-
// Prevent infinate recursion of injection into Chrome
10-
globalThis.location.href !== 'about:blank') {
11-
const injectionElement = getInjectionElement();
12-
// injectionElement is null in some playwright context tests
13-
if (injectionElement) {
14-
dummyWindow = document.createElement('iframe');
15-
dummyWindow.style.display = 'none';
16-
injectionElement.appendChild(dummyWindow);
17-
}
18-
}
19-
20-
let dummyContentWindow = dummyWindow?.contentWindow;
21-
// @ts-expect-error - Symbol is not defined on window
22-
const dummySymbol = dummyContentWindow?.Symbol;
23-
const iteratorSymbol = dummySymbol?.iterator;
24-
25-
// Capture prototype to prevent overloading
26-
function captureGlobal (globalName) {
27-
const global = dummyWindow?.contentWindow?.[globalName];
28-
29-
// if we were unable to create a dummy window, return the global
30-
// this still has the advantage of preventing aliasing of the global through shawdowing
31-
if (!global) {
32-
return globalThis[globalName]
33-
}
34-
35-
// Alias the iterator symbol to the local symbol so for loops work
36-
if (iteratorSymbol &&
37-
global?.prototype &&
38-
iteratorSymbol in global.prototype) {
39-
global.prototype[Symbol.iterator] = global.prototype[iteratorSymbol];
40-
}
41-
return global
42-
}
43-
44-
const Set$1 = captureGlobal('Set');
45-
const Reflect$1 = captureGlobal('Reflect');
46-
47-
// Clean up the dummy window
48-
dummyWindow?.remove();
5+
const Set$1 = globalThis.Set;
6+
const Reflect$1 = globalThis.Reflect;
497

508
/* global cloneInto, exportFunction, false */
519
// Tests don't define this variable so fallback to behave like chrome
@@ -2546,8 +2504,8 @@
25462504
/** @satisfies {Storage} */
25472505
const instance = new MemoryStorage();
25482506
const storage = new Proxy(instance, {
2549-
set (target, prop, value, receiver) {
2550-
Reflect$1.apply(target.setItem, target, [prop, value], receiver);
2507+
set (target, prop, value) {
2508+
Reflect$1.apply(target.setItem, target, [prop, value]);
25512509
return true
25522510
},
25532511
get (target, prop) {

build/android/contentScope.js

Lines changed: 4 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,8 @@
22
(function () {
33
'use strict';
44

5-
/* global false */
6-
7-
let dummyWindow;
8-
if ('document' in globalThis &&
9-
// Prevent infinate recursion of injection into Chrome
10-
globalThis.location.href !== 'about:blank') {
11-
const injectionElement = getInjectionElement();
12-
// injectionElement is null in some playwright context tests
13-
if (injectionElement) {
14-
dummyWindow = document.createElement('iframe');
15-
dummyWindow.style.display = 'none';
16-
injectionElement.appendChild(dummyWindow);
17-
}
18-
}
19-
20-
let dummyContentWindow = dummyWindow?.contentWindow;
21-
// @ts-expect-error - Symbol is not defined on window
22-
const dummySymbol = dummyContentWindow?.Symbol;
23-
const iteratorSymbol = dummySymbol?.iterator;
24-
25-
// Capture prototype to prevent overloading
26-
function captureGlobal (globalName) {
27-
const global = dummyWindow?.contentWindow?.[globalName];
28-
29-
// if we were unable to create a dummy window, return the global
30-
// this still has the advantage of preventing aliasing of the global through shawdowing
31-
if (!global) {
32-
return globalThis[globalName]
33-
}
34-
35-
// Alias the iterator symbol to the local symbol so for loops work
36-
if (iteratorSymbol &&
37-
global?.prototype &&
38-
iteratorSymbol in global.prototype) {
39-
global.prototype[Symbol.iterator] = global.prototype[iteratorSymbol];
40-
}
41-
return global
42-
}
43-
44-
const Set$1 = captureGlobal('Set');
45-
const Reflect$1 = captureGlobal('Reflect');
46-
47-
// Clean up the dummy window
48-
dummyWindow?.remove();
5+
const Set$1 = globalThis.Set;
6+
const Reflect$1 = globalThis.Reflect;
497

508
/* global cloneInto, exportFunction, false */
519
// Tests don't define this variable so fallback to behave like chrome
@@ -2563,8 +2521,8 @@
25632521
/** @satisfies {Storage} */
25642522
const instance = new MemoryStorage();
25652523
const storage = new Proxy(instance, {
2566-
set (target, prop, value, receiver) {
2567-
Reflect$1.apply(target.setItem, target, [prop, value], receiver);
2524+
set (target, prop, value) {
2525+
Reflect$1.apply(target.setItem, target, [prop, value]);
25682526
return true
25692527
},
25702528
get (target, prop) {

build/chrome-mv3/inject.js

Lines changed: 4 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,8 @@
22
(function () {
33
'use strict';
44

5-
/* global false */
6-
7-
let dummyWindow;
8-
if ('document' in globalThis &&
9-
// Prevent infinate recursion of injection into Chrome
10-
globalThis.location.href !== 'about:blank') {
11-
const injectionElement = getInjectionElement();
12-
// injectionElement is null in some playwright context tests
13-
if (injectionElement) {
14-
dummyWindow = document.createElement('iframe');
15-
dummyWindow.style.display = 'none';
16-
injectionElement.appendChild(dummyWindow);
17-
}
18-
}
19-
20-
let dummyContentWindow = dummyWindow?.contentWindow;
21-
// @ts-expect-error - Symbol is not defined on window
22-
const dummySymbol = dummyContentWindow?.Symbol;
23-
const iteratorSymbol = dummySymbol?.iterator;
24-
25-
// Capture prototype to prevent overloading
26-
function captureGlobal (globalName) {
27-
const global = dummyWindow?.contentWindow?.[globalName];
28-
29-
// if we were unable to create a dummy window, return the global
30-
// this still has the advantage of preventing aliasing of the global through shawdowing
31-
if (!global) {
32-
return globalThis[globalName]
33-
}
34-
35-
// Alias the iterator symbol to the local symbol so for loops work
36-
if (iteratorSymbol &&
37-
global?.prototype &&
38-
iteratorSymbol in global.prototype) {
39-
global.prototype[Symbol.iterator] = global.prototype[iteratorSymbol];
40-
}
41-
return global
42-
}
43-
44-
const Set$1 = captureGlobal('Set');
45-
const Reflect$1 = captureGlobal('Reflect');
46-
47-
// Clean up the dummy window
48-
dummyWindow?.remove();
5+
const Set$1 = globalThis.Set;
6+
const Reflect$1 = globalThis.Reflect;
497

508
/* global cloneInto, exportFunction, false */
519
// Tests don't define this variable so fallback to behave like chrome
@@ -2505,8 +2463,8 @@
25052463
/** @satisfies {Storage} */
25062464
const instance = new MemoryStorage();
25072465
const storage = new Proxy(instance, {
2508-
set (target, prop, value, receiver) {
2509-
Reflect$1.apply(target.setItem, target, [prop, value], receiver);
2466+
set (target, prop, value) {
2467+
Reflect$1.apply(target.setItem, target, [prop, value]);
25102468
return true
25112469
},
25122470
get (target, prop) {

build/chrome/inject.js

Lines changed: 1 addition & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/contentScope.js

Lines changed: 4 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,8 @@
22
(function () {
33
'use strict';
44

5-
/* global false */
6-
7-
let dummyWindow;
8-
if ('document' in globalThis &&
9-
// Prevent infinate recursion of injection into Chrome
10-
globalThis.location.href !== 'about:blank') {
11-
const injectionElement = getInjectionElement();
12-
// injectionElement is null in some playwright context tests
13-
if (injectionElement) {
14-
dummyWindow = document.createElement('iframe');
15-
dummyWindow.style.display = 'none';
16-
injectionElement.appendChild(dummyWindow);
17-
}
18-
}
19-
20-
let dummyContentWindow = dummyWindow?.contentWindow;
21-
// @ts-expect-error - Symbol is not defined on window
22-
const dummySymbol = dummyContentWindow?.Symbol;
23-
const iteratorSymbol = dummySymbol?.iterator;
24-
25-
// Capture prototype to prevent overloading
26-
function captureGlobal (globalName) {
27-
const global = dummyWindow?.contentWindow?.[globalName];
28-
29-
// if we were unable to create a dummy window, return the global
30-
// this still has the advantage of preventing aliasing of the global through shawdowing
31-
if (!global) {
32-
return globalThis[globalName]
33-
}
34-
35-
// Alias the iterator symbol to the local symbol so for loops work
36-
if (iteratorSymbol &&
37-
global?.prototype &&
38-
iteratorSymbol in global.prototype) {
39-
global.prototype[Symbol.iterator] = global.prototype[iteratorSymbol];
40-
}
41-
return global
42-
}
43-
44-
const Set$1 = captureGlobal('Set');
45-
const Reflect$1 = captureGlobal('Reflect');
46-
47-
// Clean up the dummy window
48-
dummyWindow?.remove();
5+
const Set$1 = globalThis.Set;
6+
const Reflect$1 = globalThis.Reflect;
497

508
/* global cloneInto, exportFunction, false */
519
// Tests don't define this variable so fallback to behave like chrome
@@ -2479,8 +2437,8 @@
24792437
/** @satisfies {Storage} */
24802438
const instance = new MemoryStorage();
24812439
const storage = new Proxy(instance, {
2482-
set (target, prop, value, receiver) {
2483-
Reflect$1.apply(target.setItem, target, [prop, value], receiver);
2440+
set (target, prop, value) {
2441+
Reflect$1.apply(target.setItem, target, [prop, value]);
24842442
return true
24852443
},
24862444
get (target, prop) {

build/firefox/inject.js

Lines changed: 5 additions & 51 deletions
Large diffs are not rendered by default.

build/integration/contentScope.js

Lines changed: 4 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,8 @@
22
(function () {
33
'use strict';
44

5-
/* global false */
6-
7-
let dummyWindow;
8-
if ('document' in globalThis &&
9-
// Prevent infinate recursion of injection into Chrome
10-
globalThis.location.href !== 'about:blank') {
11-
const injectionElement = getInjectionElement();
12-
// injectionElement is null in some playwright context tests
13-
if (injectionElement) {
14-
dummyWindow = document.createElement('iframe');
15-
dummyWindow.style.display = 'none';
16-
injectionElement.appendChild(dummyWindow);
17-
}
18-
}
19-
20-
let dummyContentWindow = dummyWindow?.contentWindow;
21-
// @ts-expect-error - Symbol is not defined on window
22-
const dummySymbol = dummyContentWindow?.Symbol;
23-
const iteratorSymbol = dummySymbol?.iterator;
24-
25-
// Capture prototype to prevent overloading
26-
function captureGlobal (globalName) {
27-
const global = dummyWindow?.contentWindow?.[globalName];
28-
29-
// if we were unable to create a dummy window, return the global
30-
// this still has the advantage of preventing aliasing of the global through shawdowing
31-
if (!global) {
32-
return globalThis[globalName]
33-
}
34-
35-
// Alias the iterator symbol to the local symbol so for loops work
36-
if (iteratorSymbol &&
37-
global?.prototype &&
38-
iteratorSymbol in global.prototype) {
39-
global.prototype[Symbol.iterator] = global.prototype[iteratorSymbol];
40-
}
41-
return global
42-
}
43-
44-
const Set$1 = captureGlobal('Set');
45-
const Reflect$1 = captureGlobal('Reflect');
46-
47-
// Clean up the dummy window
48-
dummyWindow?.remove();
5+
const Set$1 = globalThis.Set;
6+
const Reflect$1 = globalThis.Reflect;
497

508
/* global cloneInto, exportFunction, false */
519
// Tests don't define this variable so fallback to behave like chrome
@@ -2479,8 +2437,8 @@
24792437
/** @satisfies {Storage} */
24802438
const instance = new MemoryStorage();
24812439
const storage = new Proxy(instance, {
2482-
set (target, prop, value, receiver) {
2483-
Reflect$1.apply(target.setItem, target, [prop, value], receiver);
2440+
set (target, prop, value) {
2441+
Reflect$1.apply(target.setItem, target, [prop, value]);
24842442
return true
24852443
},
24862444
get (target, prop) {

build/windows/contentScope.js

Lines changed: 4 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,8 @@
22
(function () {
33
'use strict';
44

5-
/* global false */
6-
7-
let dummyWindow;
8-
if ('document' in globalThis &&
9-
// Prevent infinate recursion of injection into Chrome
10-
globalThis.location.href !== 'about:blank') {
11-
const injectionElement = getInjectionElement();
12-
// injectionElement is null in some playwright context tests
13-
if (injectionElement) {
14-
dummyWindow = document.createElement('iframe');
15-
dummyWindow.style.display = 'none';
16-
injectionElement.appendChild(dummyWindow);
17-
}
18-
}
19-
20-
let dummyContentWindow = dummyWindow?.contentWindow;
21-
// @ts-expect-error - Symbol is not defined on window
22-
const dummySymbol = dummyContentWindow?.Symbol;
23-
const iteratorSymbol = dummySymbol?.iterator;
24-
25-
// Capture prototype to prevent overloading
26-
function captureGlobal (globalName) {
27-
const global = dummyWindow?.contentWindow?.[globalName];
28-
29-
// if we were unable to create a dummy window, return the global
30-
// this still has the advantage of preventing aliasing of the global through shawdowing
31-
if (!global) {
32-
return globalThis[globalName]
33-
}
34-
35-
// Alias the iterator symbol to the local symbol so for loops work
36-
if (iteratorSymbol &&
37-
global?.prototype &&
38-
iteratorSymbol in global.prototype) {
39-
global.prototype[Symbol.iterator] = global.prototype[iteratorSymbol];
40-
}
41-
return global
42-
}
43-
44-
const Set$1 = captureGlobal('Set');
45-
const Reflect$1 = captureGlobal('Reflect');
46-
47-
// Clean up the dummy window
48-
dummyWindow?.remove();
5+
const Set$1 = globalThis.Set;
6+
const Reflect$1 = globalThis.Reflect;
497

508
/* global cloneInto, exportFunction, false */
519
// Tests don't define this variable so fallback to behave like chrome
@@ -2546,8 +2504,8 @@
25462504
/** @satisfies {Storage} */
25472505
const instance = new MemoryStorage();
25482506
const storage = new Proxy(instance, {
2549-
set (target, prop, value, receiver) {
2550-
Reflect$1.apply(target.setItem, target, [prop, value], receiver);
2507+
set (target, prop, value) {
2508+
Reflect$1.apply(target.setItem, target, [prop, value]);
25512509
return true
25522510
},
25532511
get (target, prop) {

0 commit comments

Comments
 (0)