You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2014/03/27 15:22:11 UTC

[02/34] js commit: CB-6007 Fix findCordovaPath() not working when path contains a query param

CB-6007 Fix findCordovaPath() not working when path contains a query param


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

Branch: refs/heads/browserify
Commit: 799eed5f90a2e332d9f90257a7b4faf29ddcebe3
Parents: d87d7d7
Author: Andrew Grieve <ag...@chromium.org>
Authored: Tue Feb 11 11:05:27 2014 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Tue Feb 11 11:05:58 2014 -0500

----------------------------------------------------------------------
 src/common/pluginloader.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/799eed5f/src/common/pluginloader.js
----------------------------------------------------------------------
diff --git a/src/common/pluginloader.js b/src/common/pluginloader.js
index 07e0593..92cbaed 100644
--- a/src/common/pluginloader.js
+++ b/src/common/pluginloader.js
@@ -109,7 +109,7 @@ function findCordovaPath() {
     var scripts = document.getElementsByTagName('script');
     var term = 'cordova.js';
     for (var n = scripts.length-1; n>-1; n--) {
-        var src = scripts[n].src;
+        var src = scripts[n].src.replace(/\?.*$/, ''); // Strip any query param (CB-6007).
         if (src.indexOf(term) == (src.length - term.length)) {
             path = src.substring(0, src.length - term.length);
             break;