File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -141,6 +141,10 @@ export class WebCompat extends ContentFeature {
141141 if ( this . getFeatureSettingEnabled ( 'enumerateDevices' ) ) {
142142 this . deviceEnumerationFix ( ) ;
143143 }
144+ // Used by Android in the non adsjs version
145+ if ( this . getFeatureSettingEnabled ( 'viewportWidthLegacy' ) ) {
146+ this . viewportWidthFix ( ) ;
147+ }
144148 }
145149
146150 /**
@@ -151,10 +155,7 @@ export class WebCompat extends ContentFeature {
151155 onUserPreferencesMerged ( _updatedConfig ) {
152156 // Re-apply viewport width fix if viewport settings might have changed
153157 if ( this . getFeatureSettingEnabled ( 'viewportWidth' ) ) {
154- if ( ! this . _viewportWidthFixApplied ) {
155- this . viewportWidthFix ( ) ;
156- this . _viewportWidthFixApplied = true ;
157- }
158+ this . viewportWidthFix ( ) ;
158159 }
159160 }
160161
@@ -698,6 +699,10 @@ export class WebCompat extends ContentFeature {
698699 }
699700
700701 viewportWidthFix ( ) {
702+ if ( this . _viewportWidthFixApplied ) {
703+ return ;
704+ }
705+ this . _viewportWidthFixApplied = true ;
701706 if ( document . readyState === 'loading' ) {
702707 // if the document is not ready, we may miss the original viewport tag
703708 document . addEventListener ( 'DOMContentLoaded' , ( ) => this . viewportWidthFixInner ( ) ) ;
You can’t perform that action at this time.
0 commit comments