File tree 1 file changed +12
-4
lines changed
1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -4,10 +4,17 @@ import { URL } from '../captured-globals.js'
4
4
/**
5
5
* Fixes incorrect sizing value for outerHeight and outerWidth
6
6
*/
7
- function windowSizingFix ( ) {
8
- // macOS browser incorrectly reports window height for window.screenY / window.screenTop
7
+ function windowSizingFix ( settings ) {
8
+ // macOS browser incorrectly reports screen height for window.screenY / window.screenTop
9
9
if ( window . screenY === window . screen . height ) {
10
- window . screenY = window . screenTop = 0
10
+ let screenYOverride = settings ?. screenYOverride
11
+
12
+ if ( typeof screenYOverride === 'undefined' ) {
13
+ // @ts -expect-error - typescript known about availTop in this context
14
+ screenYOverride = window . screen . availTop
15
+ }
16
+
17
+ window . screenY = window . screenTop = screenYOverride
11
18
}
12
19
13
20
if ( window . outerHeight !== 0 && window . outerWidth !== 0 ) {
@@ -81,7 +88,8 @@ export default class WebCompat extends ContentFeature {
81
88
82
89
init ( ) {
83
90
if ( this . getFeatureSettingEnabled ( 'windowSizing' ) ) {
84
- windowSizingFix ( )
91
+ const settings = this . getFeatureSetting ( 'windowSizing' )
92
+ windowSizingFix ( settings )
85
93
}
86
94
if ( this . getFeatureSettingEnabled ( 'navigatorCredentials' ) ) {
87
95
this . navigatorCredentialsFix ( )
You can’t perform that action at this time.
0 commit comments