diff --git a/js/push.js b/js/push.js index 96dd476f3..761c0a2b8 100644 --- a/js/push.js +++ b/js/push.js @@ -237,8 +237,9 @@ if (options._timeout) { clearTimeout(options._timeout); } + if (xhr.readyState === 4) { - if (xhr.status === 200) { + if (xhr.status === 200 || (isFileProtocol && xhr.status === 0)) { success(xhr, options); } else { failure(options.url); @@ -265,14 +266,6 @@ xhr.send(); - if (isFileProtocol) { - if (xhr.status === 0 || xhr.status === 200) { - success(xhr, options); - } else { - failure(options.url); - } - } - if (xhr.readyState && !options.ignorePush) { cachePush(); }