@@ -73,8 +73,8 @@ function manageWin_(win) {
73
73
function instrumentDocWrite ( parent , win ) {
74
74
const doc = win . document ;
75
75
const { close} = doc ;
76
- doc . close = function ( ) {
77
- parent . ampManageWin = function ( win ) {
76
+ doc . close = function ( ) {
77
+ parent . ampManageWin = function ( win ) {
78
78
manageWin ( win ) ;
79
79
} ;
80
80
if ( ! parent . ampSeen ) {
@@ -93,7 +93,7 @@ function instrumentDocWrite(parent, win) {
93
93
*/
94
94
function instrumentSrcdoc ( parent , iframe ) {
95
95
let srcdoc = iframe . getAttribute ( 'srcdoc' ) ;
96
- parent . ampManageWin = function ( win ) {
96
+ parent . ampManageWin = function ( win ) {
97
97
manageWin ( win ) ;
98
98
} ;
99
99
srcdoc += '<script>window.parent.ampManageWin(window)</script>' ;
@@ -159,7 +159,7 @@ function installObserver(win) {
159
159
if ( ! window . MutationObserver ) {
160
160
return ;
161
161
}
162
- const observer = new MutationObserver ( function ( mutations ) {
162
+ const observer = new MutationObserver ( function ( mutations ) {
163
163
for ( let i = 0 ; i < mutations . length ; i ++ ) {
164
164
maybeInstrumentsNodes ( win , mutations [ i ] . addedNodes ) ;
165
165
}
@@ -177,14 +177,14 @@ function installObserver(win) {
177
177
function instrumentEntryPoints ( win ) {
178
178
// Change setTimeout to respect a minimum timeout.
179
179
const { setTimeout} = win ;
180
- win . setTimeout = function ( fn , time ) {
180
+ win . setTimeout = function ( fn , time ) {
181
181
time = minTime ( time ) ;
182
182
arguments [ 1 ] = time ;
183
183
return setTimeout . apply ( this , arguments ) ;
184
184
} ;
185
185
// Implement setInterval in terms of setTimeout to make
186
186
// it respect the same rules
187
- win . setInterval = function ( fn ) {
187
+ win . setInterval = function ( fn ) {
188
188
const id = intervalId ++ ;
189
189
const args = Array . prototype . slice . call ( arguments ) ;
190
190
/**
@@ -195,7 +195,8 @@ function instrumentEntryPoints(win) {
195
195
next ( ) ;
196
196
if ( typeof fn == 'string' ) {
197
197
// Handle rare and dangerous string arg case.
198
- return ( 0 , win . eval /*NOT OK but whatcha gonna do.*/ ) . call ( win , fn ) ; // lgtm [js/useless-expression]
198
+ return ( 0 , win . eval ) /*NOT OK but whatcha gonna do.*/
199
+ . call ( win , fn ) ; // lgtm [js/useless-expression]
199
200
} else {
200
201
return fn . apply ( this , arguments ) ;
201
202
}
@@ -211,7 +212,7 @@ function instrumentEntryPoints(win) {
211
212
return id ;
212
213
} ;
213
214
const { clearInterval} = win ;
214
- win . clearInterval = function ( id ) {
215
+ win . clearInterval = function ( id ) {
215
216
clearInterval ( id ) ;
216
217
win . clearTimeout ( intervals [ id ] ) ;
217
218
delete intervals [ id ] ;
@@ -235,11 +236,11 @@ function blockSyncPopups(win) {
235
236
}
236
237
try {
237
238
win . alert = maybeThrow ;
238
- win . prompt = function ( ) {
239
+ win . prompt = function ( ) {
239
240
maybeThrow ( ) ;
240
241
return '' ;
241
242
} ;
242
- win . confirm = function ( ) {
243
+ win . confirm = function ( ) {
243
244
maybeThrow ( ) ;
244
245
return false ;
245
246
} ;
@@ -269,7 +270,7 @@ function minTime(time) {
269
270
* Installs embed state listener.
270
271
*/
271
272
export function installEmbedStateListener ( ) {
272
- listenParent ( window , 'embed-state' , function ( data ) {
273
+ listenParent ( window , 'embed-state' , function ( data ) {
273
274
inViewport = data [ 'inViewport' ] ;
274
275
} ) ;
275
276
}
0 commit comments