Skip to content

Commit db764ac

Browse files
Add missing Safari interface (#162)
1 parent 4c3dd55 commit db764ac

File tree

8 files changed

+113
-1
lines changed

8 files changed

+113
-1
lines changed

Sources/ContentScopeScripts/dist/contentScope.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4204,9 +4204,25 @@
42044204
}
42054205
}
42064206

4207+
function safariObjectFix () {
4208+
try {
4209+
if (window.safari) {
4210+
return
4211+
}
4212+
defineProperty(window, 'safari', {
4213+
value: {},
4214+
configurable: true,
4215+
enumerable: true
4216+
});
4217+
} catch {
4218+
// Ignore exceptions that could be caused by conflicting with other extensions
4219+
}
4220+
}
4221+
42074222
function init$1 () {
42084223
windowSizingFix();
42094224
navigatorCredentialsFix();
4225+
safariObjectFix();
42104226
}
42114227

42124228
var webCompat = /*#__PURE__*/Object.freeze({

build/android/contentScope.js

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/chrome-mv3/inject.js

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/chrome/inject.js

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

build/firefox/inject.js

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/integration/contentScope.js

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/windows/contentScope.js

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/features/web-compat.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,23 @@ function navigatorCredentialsFix () {
3535
}
3636
}
3737

38+
function safariObjectFix () {
39+
try {
40+
if (window.safari) {
41+
return
42+
}
43+
defineProperty(window, 'safari', {
44+
value: {},
45+
configurable: true,
46+
enumerable: true
47+
})
48+
} catch {
49+
// Ignore exceptions that could be caused by conflicting with other extensions
50+
}
51+
}
52+
3853
export function init () {
3954
windowSizingFix()
4055
navigatorCredentialsFix()
56+
safariObjectFix()
4157
}

0 commit comments

Comments
 (0)