cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brianler...@apache.org
Subject [12/15] js commit: reverted out urlutil.exists check / save that battle for another PR
Date Wed, 11 Dec 2013 21:54:31 GMT
reverted out urlutil.exists check / save that battle for another PR


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/c770c383
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/c770c383
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/c770c383

Branch: refs/heads/master
Commit: c770c3838fd9c91628d0fd2578da841beed86775
Parents: 4e0ca1c
Author: brianleroux <b@brian.io>
Authored: Wed Dec 11 12:47:48 2013 +1000
Committer: brianleroux <b@brian.io>
Committed: Wed Dec 11 12:47:48 2013 +1000

----------------------------------------------------------------------
 src/common/pluginloader.js | 24 +++++++++++-------------
 src/common/urlutil.js      |  9 ---------
 2 files changed, 11 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/c770c383/src/common/pluginloader.js
----------------------------------------------------------------------
diff --git a/src/common/pluginloader.js b/src/common/pluginloader.js
index 652d576..07e0593 100644
--- a/src/common/pluginloader.js
+++ b/src/common/pluginloader.js
@@ -91,19 +91,17 @@ function handlePluginsObject(path, moduleList, finishPluginLoading) {
 function injectPluginScript(pathPrefix, finishPluginLoading) {
     var pluginPath = pathPrefix + 'cordova_plugins.js';
 
-    if (urlutil.exists(pluginPath)) {
-        injectScript(pluginPath, function() {
-            try {
-                var moduleList = require("cordova/plugin_list");
-                handlePluginsObject(pathPrefix, moduleList, finishPluginLoading);
-            }
-            catch (e) {
-                // Error loading cordova_plugins.js, file not found or something
-                // this is an acceptable error, pre-3.0.0, so we just move on.
-                finishPluginLoading();
-            }
-        }, finishPluginLoading); // also, add script load error handler for file not found
-    }
+    injectScript(pluginPath, function() {
+        try {
+            var moduleList = require("cordova/plugin_list");
+            handlePluginsObject(pathPrefix, moduleList, finishPluginLoading);
+        }
+        catch (e) {
+            // Error loading cordova_plugins.js, file not found or something
+            // this is an acceptable error, pre-3.0.0, so we just move on.
+            finishPluginLoading();
+        }
+    }, finishPluginLoading); // also, add script load error handler for file not found
 }
 
 function findCordovaPath() {

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/c770c383/src/common/urlutil.js
----------------------------------------------------------------------
diff --git a/src/common/urlutil.js b/src/common/urlutil.js
index d9b2675..09ebc62 100644
--- a/src/common/urlutil.js
+++ b/src/common/urlutil.js
@@ -30,12 +30,3 @@ exports.makeAbsolute = function makeAbsolute(url) {
     return anchorEl.href;
 };
 
-/**
- * Sync test if a URL exists.
- */
-exports.exists = function exists(url) {
-    var xhr = new XMLHttpRequest();
-    xhr.open('HEAD', url, false);
-    xhr.send();
-    return xhr.status != 404;
-};


Mime
View raw message