cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [1/2] git commit: CB-4858 Convert relative URLs to absolute URLs in JS
Date Thu, 10 Oct 2013 16:41:00 GMT
Updated Branches:
  refs/heads/dev 8df4b7d03 -> 5ef517100


CB-4858 Convert relative URLs to absolute URLs in JS


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/commit/8a6bc018
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/8a6bc018
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/8a6bc018

Branch: refs/heads/dev
Commit: 8a6bc01814b6d7eb3f605ad47a45d33163153a66
Parents: 8df4b7d
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Thu Oct 10 12:21:35 2013 -0400
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Thu Oct 10 12:21:35 2013 -0400

----------------------------------------------------------------------
 plugin.xml          |  3 +++
 www/InAppBrowser.js | 12 +++++++-----
 2 files changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/8a6bc018/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index 9a53bd2..341b4be 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -8,6 +8,9 @@
     <license>Apache 2.0</license>
     <keywords>cordova,in,app,browser,inappbrowser</keywords>
 
+    <engines>
+      <engine name="cordova" version=">=3.1.0" /><!-- Needs cordova/urlutil -->
+    </engines>
 
     <js-module src="www/InAppBrowser.js" name="InAppBrowser">
         <clobbers target="window.open" />

http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/8a6bc018/www/InAppBrowser.js
----------------------------------------------------------------------
diff --git a/www/InAppBrowser.js b/www/InAppBrowser.js
index 83f5a22..3fe9261 100644
--- a/www/InAppBrowser.js
+++ b/www/InAppBrowser.js
@@ -22,6 +22,7 @@
 var exec = require('cordova/exec');
 var channel = require('cordova/channel');
 var modulemapper = require('cordova/modulemapper');
+var urlutil = require('cordova/urlutil');
 
 function InAppBrowser() {
    this.channels = {
@@ -81,17 +82,18 @@ InAppBrowser.prototype = {
 };
 
 module.exports = function(strUrl, strWindowName, strWindowFeatures) {
-    var iab = new InAppBrowser();
-    var cb = function(eventname) {
-       iab._eventHandler(eventname);
-    };
-
     // Don't catch calls that write to existing frames (e.g. named iframes).
     if (window.frames && window.frames[strWindowName]) {
         var origOpenFunc = modulemapper.getOriginalSymbol(window, 'open');
         return origOpenFunc.apply(window, arguments);
     }
 
+    strUrl = urlutil.makeAbsolute(strUrl);
+    var iab = new InAppBrowser();
+    var cb = function(eventname) {
+       iab._eventHandler(eventname);
+    };
+
     exec(cb, cb, "InAppBrowser", "open", [strUrl, strWindowName, strWindowFeatures]);
     return iab;
 };


Mime
View raw message