Check for document before checking for readyState

This commit is contained in:
Wes Bos
2016-06-13 11:32:10 -04:00
committed by GitHub
parent a2055f9d3e
commit 6d2a942dd2

View File

@@ -122,7 +122,7 @@ chrome.extension.sendMessage({}, function(response) {
function initializeWhenReady(document) {
var readyStateCheckInterval = setInterval(function() {
if (document.readyState === 'complete') {
if (document && document.readyState === 'complete') {
clearInterval(readyStateCheckInterval);
initializeNow(document);
}