check if document already interactive (DOMContentLoaded won't fire if already interactive)
This commit is contained in:
parent
6e51b45c7f
commit
11b4c9b4c4
|
@ -1,5 +1,5 @@
|
||||||
var whenEnvIsLoaded = function(cb) {
|
var whenEnvIsLoaded = function(cb) {
|
||||||
if (typeof document !== 'undefined' && document !== null) {
|
if (typeof document !== 'undefined' && document !== null && !/comp|inter|loaded/.test(document.readyState)) {
|
||||||
document.addEventListener('DOMContentLoaded', cb);
|
document.addEventListener('DOMContentLoaded', cb);
|
||||||
} else {
|
} else {
|
||||||
cb();
|
cb();
|
||||||
|
|
Loading…
Reference in New Issue