Index: composer.postload.js |
=================================================================== |
--- a/composer.postload.js |
+++ b/composer.postload.js |
@@ -577,10 +577,26 @@ |
} |
}); |
} |
break; |
} |
}); |
if (window == window.top) |
- ext.backgroundPage.sendMessage({type: "composer.ready"}); |
+ { |
+ if (document.visibilityState == "prerender") |
Sebastian Noack
2017/05/20 11:19:06
Note that the visibility API doesn't exists before
Manish Jethani
2017/05/20 19:01:06
Yes, then visibilityState should just be undefined
Sebastian Noack
2017/05/21 20:31:01
Yeah, I supposed so. Thanks for confirming my assu
Manish Jethani
2017/08/24 14:07:57
Done.
|
+ { |
+ let onVisibilitychange = function() |
+ { |
+ document.removeEventListener("visibilitychange", onVisibilitychange); |
+ |
Sebastian Noack
2017/05/21 20:31:01
Nit: The blank line here looks weird.
Manish Jethani
2017/08/24 14:07:57
Acknowledged.
|
+ ext.backgroundPage.sendMessage({type: "composer.ready"}); |
+ }; |
+ |
+ document.addEventListener("visibilitychange", onVisibilitychange); |
+ } |
+ else |
+ { |
+ ext.backgroundPage.sendMessage({type: "composer.ready"}); |
+ } |
+ } |
} |