Skip to content

Commit f15a5d3

Browse files
Release build 9.4.0 [ci release]
1 parent 93cc3b0 commit f15a5d3

File tree

12 files changed

+852
-13
lines changed

12 files changed

+852
-13
lines changed

CHANGELOG.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
- Duck Player custom error copy update (#1706)
1+
- Device enumeration blocking WebCompat feature (#1724)

Sources/ContentScopeScripts/dist/contentScope.js

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1346,7 +1346,16 @@
13461346
android: [...baseFeatures, "webCompat", "breakageReporting", "duckPlayer", "messageBridge"],
13471347
"android-broker-protection": ["brokerProtection"],
13481348
"android-autofill-password-import": ["autofillPasswordImport"],
1349-
windows: ["cookie", ...baseFeatures, "windowsPermissionUsage", "duckPlayer", "brokerProtection", "breakageReporting", "messageBridge"],
1349+
windows: [
1350+
"cookie",
1351+
...baseFeatures,
1352+
"windowsPermissionUsage",
1353+
"duckPlayer",
1354+
"brokerProtection",
1355+
"breakageReporting",
1356+
"messageBridge",
1357+
"webCompat"
1358+
],
13501359
firefox: ["cookie", ...baseFeatures, "clickToLoad"],
13511360
chrome: ["cookie", ...baseFeatures, "clickToLoad"],
13521361
"chrome-mv3": ["cookie", ...baseFeatures, "clickToLoad"],
@@ -4351,6 +4360,9 @@
43514360
if (this.getFeatureSettingEnabled("modifyCookies")) {
43524361
this.modifyCookies();
43534362
}
4363+
if (this.getFeatureSettingEnabled("disableDeviceEnumeration") || this.getFeatureSettingEnabled("disableDeviceEnumerationFrames")) {
4364+
this.preventDeviceEnumeration();
4365+
}
43544366
}
43554367
/** Shim Web Share API in Android WebView */
43564368
shimWebShare() {
@@ -4877,6 +4889,26 @@
48774889
this.forceViewportTag(viewportTag, newContent.join(", "));
48784890
}
48794891
}
4892+
preventDeviceEnumeration() {
4893+
if (!window.MediaDevices) {
4894+
return;
4895+
}
4896+
let disableDeviceEnumeration = false;
4897+
const isFrame = window.self !== window.top;
4898+
if (isFrame) {
4899+
disableDeviceEnumeration = this.getFeatureSettingEnabled("disableDeviceEnumerationFrames");
4900+
} else {
4901+
disableDeviceEnumeration = this.getFeatureSettingEnabled("disableDeviceEnumeration");
4902+
}
4903+
if (disableDeviceEnumeration) {
4904+
const enumerateDevicesProxy = new DDGProxy(this, MediaDevices.prototype, "enumerateDevices", {
4905+
apply() {
4906+
return Promise.resolve([]);
4907+
}
4908+
});
4909+
enumerateDevicesProxy.overload();
4910+
}
4911+
}
48804912
};
48814913
_activeShareRequest = new WeakMap();
48824914
_activeScreenLockRequest = new WeakMap();

Sources/ContentScopeScripts/dist/contentScopeIsolated.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2051,7 +2051,16 @@
20512051
android: [...baseFeatures, "webCompat", "breakageReporting", "duckPlayer", "messageBridge"],
20522052
"android-broker-protection": ["brokerProtection"],
20532053
"android-autofill-password-import": ["autofillPasswordImport"],
2054-
windows: ["cookie", ...baseFeatures, "windowsPermissionUsage", "duckPlayer", "brokerProtection", "breakageReporting", "messageBridge"],
2054+
windows: [
2055+
"cookie",
2056+
...baseFeatures,
2057+
"windowsPermissionUsage",
2058+
"duckPlayer",
2059+
"brokerProtection",
2060+
"breakageReporting",
2061+
"messageBridge",
2062+
"webCompat"
2063+
],
20552064
firefox: ["cookie", ...baseFeatures, "clickToLoad"],
20562065
chrome: ["cookie", ...baseFeatures, "clickToLoad"],
20572066
"chrome-mv3": ["cookie", ...baseFeatures, "clickToLoad"],

build/android/autofillPasswordImport.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,16 @@
518518
android: [...baseFeatures, "webCompat", "breakageReporting", "duckPlayer", "messageBridge"],
519519
"android-broker-protection": ["brokerProtection"],
520520
"android-autofill-password-import": ["autofillPasswordImport"],
521-
windows: ["cookie", ...baseFeatures, "windowsPermissionUsage", "duckPlayer", "brokerProtection", "breakageReporting", "messageBridge"],
521+
windows: [
522+
"cookie",
523+
...baseFeatures,
524+
"windowsPermissionUsage",
525+
"duckPlayer",
526+
"brokerProtection",
527+
"breakageReporting",
528+
"messageBridge",
529+
"webCompat"
530+
],
522531
firefox: ["cookie", ...baseFeatures, "clickToLoad"],
523532
chrome: ["cookie", ...baseFeatures, "clickToLoad"],
524533
"chrome-mv3": ["cookie", ...baseFeatures, "clickToLoad"],

build/android/brokerProtection.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2017,7 +2017,16 @@
20172017
android: [...baseFeatures, "webCompat", "breakageReporting", "duckPlayer", "messageBridge"],
20182018
"android-broker-protection": ["brokerProtection"],
20192019
"android-autofill-password-import": ["autofillPasswordImport"],
2020-
windows: ["cookie", ...baseFeatures, "windowsPermissionUsage", "duckPlayer", "brokerProtection", "breakageReporting", "messageBridge"],
2020+
windows: [
2021+
"cookie",
2022+
...baseFeatures,
2023+
"windowsPermissionUsage",
2024+
"duckPlayer",
2025+
"brokerProtection",
2026+
"breakageReporting",
2027+
"messageBridge",
2028+
"webCompat"
2029+
],
20212030
firefox: ["cookie", ...baseFeatures, "clickToLoad"],
20222031
chrome: ["cookie", ...baseFeatures, "clickToLoad"],
20232032
"chrome-mv3": ["cookie", ...baseFeatures, "clickToLoad"],

build/android/contentScope.js

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1346,7 +1346,16 @@
13461346
android: [...baseFeatures, "webCompat", "breakageReporting", "duckPlayer", "messageBridge"],
13471347
"android-broker-protection": ["brokerProtection"],
13481348
"android-autofill-password-import": ["autofillPasswordImport"],
1349-
windows: ["cookie", ...baseFeatures, "windowsPermissionUsage", "duckPlayer", "brokerProtection", "breakageReporting", "messageBridge"],
1349+
windows: [
1350+
"cookie",
1351+
...baseFeatures,
1352+
"windowsPermissionUsage",
1353+
"duckPlayer",
1354+
"brokerProtection",
1355+
"breakageReporting",
1356+
"messageBridge",
1357+
"webCompat"
1358+
],
13501359
firefox: ["cookie", ...baseFeatures, "clickToLoad"],
13511360
chrome: ["cookie", ...baseFeatures, "clickToLoad"],
13521361
"chrome-mv3": ["cookie", ...baseFeatures, "clickToLoad"],
@@ -6328,6 +6337,9 @@
63286337
if (this.getFeatureSettingEnabled("modifyCookies")) {
63296338
this.modifyCookies();
63306339
}
6340+
if (this.getFeatureSettingEnabled("disableDeviceEnumeration") || this.getFeatureSettingEnabled("disableDeviceEnumerationFrames")) {
6341+
this.preventDeviceEnumeration();
6342+
}
63316343
}
63326344
/** Shim Web Share API in Android WebView */
63336345
shimWebShare() {
@@ -6854,6 +6866,26 @@
68546866
this.forceViewportTag(viewportTag, newContent.join(", "));
68556867
}
68566868
}
6869+
preventDeviceEnumeration() {
6870+
if (!window.MediaDevices) {
6871+
return;
6872+
}
6873+
let disableDeviceEnumeration = false;
6874+
const isFrame = window.self !== window.top;
6875+
if (isFrame) {
6876+
disableDeviceEnumeration = this.getFeatureSettingEnabled("disableDeviceEnumerationFrames");
6877+
} else {
6878+
disableDeviceEnumeration = this.getFeatureSettingEnabled("disableDeviceEnumeration");
6879+
}
6880+
if (disableDeviceEnumeration) {
6881+
const enumerateDevicesProxy = new DDGProxy(this, MediaDevices.prototype, "enumerateDevices", {
6882+
apply() {
6883+
return Promise.resolve([]);
6884+
}
6885+
});
6886+
enumerateDevicesProxy.overload();
6887+
}
6888+
}
68576889
};
68586890
_activeShareRequest = new WeakMap();
68596891
_activeScreenLockRequest = new WeakMap();

build/chrome-mv3/inject.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,16 @@
12941294
android: [...baseFeatures, "webCompat", "breakageReporting", "duckPlayer", "messageBridge"],
12951295
"android-broker-protection": ["brokerProtection"],
12961296
"android-autofill-password-import": ["autofillPasswordImport"],
1297-
windows: ["cookie", ...baseFeatures, "windowsPermissionUsage", "duckPlayer", "brokerProtection", "breakageReporting", "messageBridge"],
1297+
windows: [
1298+
"cookie",
1299+
...baseFeatures,
1300+
"windowsPermissionUsage",
1301+
"duckPlayer",
1302+
"brokerProtection",
1303+
"breakageReporting",
1304+
"messageBridge",
1305+
"webCompat"
1306+
],
12981307
firefox: ["cookie", ...baseFeatures, "clickToLoad"],
12991308
chrome: ["cookie", ...baseFeatures, "clickToLoad"],
13001309
"chrome-mv3": ["cookie", ...baseFeatures, "clickToLoad"],

build/firefox/inject.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,16 @@
12941294
android: [...baseFeatures, "webCompat", "breakageReporting", "duckPlayer", "messageBridge"],
12951295
"android-broker-protection": ["brokerProtection"],
12961296
"android-autofill-password-import": ["autofillPasswordImport"],
1297-
windows: ["cookie", ...baseFeatures, "windowsPermissionUsage", "duckPlayer", "brokerProtection", "breakageReporting", "messageBridge"],
1297+
windows: [
1298+
"cookie",
1299+
...baseFeatures,
1300+
"windowsPermissionUsage",
1301+
"duckPlayer",
1302+
"brokerProtection",
1303+
"breakageReporting",
1304+
"messageBridge",
1305+
"webCompat"
1306+
],
12981307
firefox: ["cookie", ...baseFeatures, "clickToLoad"],
12991308
chrome: ["cookie", ...baseFeatures, "clickToLoad"],
13001309
"chrome-mv3": ["cookie", ...baseFeatures, "clickToLoad"],

build/integration/contentScope.js

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2849,7 +2849,16 @@
28492849
android: [...baseFeatures, "webCompat", "breakageReporting", "duckPlayer", "messageBridge"],
28502850
"android-broker-protection": ["brokerProtection"],
28512851
"android-autofill-password-import": ["autofillPasswordImport"],
2852-
windows: ["cookie", ...baseFeatures, "windowsPermissionUsage", "duckPlayer", "brokerProtection", "breakageReporting", "messageBridge"],
2852+
windows: [
2853+
"cookie",
2854+
...baseFeatures,
2855+
"windowsPermissionUsage",
2856+
"duckPlayer",
2857+
"brokerProtection",
2858+
"breakageReporting",
2859+
"messageBridge",
2860+
"webCompat"
2861+
],
28532862
firefox: ["cookie", ...baseFeatures, "clickToLoad"],
28542863
chrome: ["cookie", ...baseFeatures, "clickToLoad"],
28552864
"chrome-mv3": ["cookie", ...baseFeatures, "clickToLoad"],
@@ -14481,6 +14490,9 @@ ul.messages {
1448114490
if (this.getFeatureSettingEnabled("modifyCookies")) {
1448214491
this.modifyCookies();
1448314492
}
14493+
if (this.getFeatureSettingEnabled("disableDeviceEnumeration") || this.getFeatureSettingEnabled("disableDeviceEnumerationFrames")) {
14494+
this.preventDeviceEnumeration();
14495+
}
1448414496
}
1448514497
/** Shim Web Share API in Android WebView */
1448614498
shimWebShare() {
@@ -15007,6 +15019,26 @@ ul.messages {
1500715019
this.forceViewportTag(viewportTag, newContent.join(", "));
1500815020
}
1500915021
}
15022+
preventDeviceEnumeration() {
15023+
if (!window.MediaDevices) {
15024+
return;
15025+
}
15026+
let disableDeviceEnumeration = false;
15027+
const isFrame = window.self !== window.top;
15028+
if (isFrame) {
15029+
disableDeviceEnumeration = this.getFeatureSettingEnabled("disableDeviceEnumerationFrames");
15030+
} else {
15031+
disableDeviceEnumeration = this.getFeatureSettingEnabled("disableDeviceEnumeration");
15032+
}
15033+
if (disableDeviceEnumeration) {
15034+
const enumerateDevicesProxy = new DDGProxy(this, MediaDevices.prototype, "enumerateDevices", {
15035+
apply() {
15036+
return Promise.resolve([]);
15037+
}
15038+
});
15039+
enumerateDevicesProxy.overload();
15040+
}
15041+
}
1501015042
};
1501115043
_activeShareRequest = new WeakMap();
1501215044
_activeScreenLockRequest = new WeakMap();

0 commit comments

Comments
 (0)