We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d49ce88 commit 8831b1fCopy full SHA for 8831b1f
plugins/optimization-detective/detect-loader.js
@@ -10,15 +10,12 @@
10
*/
11
// eslint-disable-next-line no-unused-vars
12
async function load( detectSrc, detectArgs ) {
13
- const doc = document;
14
- const win = window;
15
-
16
// Wait until the resources on the page have fully loaded.
17
await new Promise( ( resolve ) => {
18
- if ( doc.readyState === 'complete' ) {
+ if ( document.readyState === 'complete' ) {
19
resolve();
20
} else {
21
- win.addEventListener( 'load', resolve, { once: true } );
+ window.addEventListener( 'load', resolve, { once: true } );
22
}
23
} );
24
0 commit comments