From 27b5c38eb48876e4776b9a6fe7b7f7903f3b0a39 Mon Sep 17 00:00:00 2001 From: Jonas Frost Date: Fri, 22 May 2015 09:21:36 -0700 Subject: [PATCH] fixed file:// urls on some webkit based systems --- js/push.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/js/push.js b/js/push.js index 96dd476..761c0a2 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(); }