cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject js commit: [all] CB-2641 - Use modulemapper to retrieve the original symbol
Date Wed, 03 Apr 2013 01:07:54 GMT
Updated Branches:
  refs/heads/master ee4719c7a -> a429d52bd


[all] CB-2641 - Use modulemapper to retrieve the original symbol


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

Branch: refs/heads/master
Commit: a429d52bd92f91d132735f9607a7e1f45bbd78d5
Parents: ee4719c
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Tue Apr 2 21:07:16 2013 -0400
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Tue Apr 2 21:07:16 2013 -0400

----------------------------------------------------------------------
 lib/common/plugin/InAppBrowser.js |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/a429d52b/lib/common/plugin/InAppBrowser.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/InAppBrowser.js b/lib/common/plugin/InAppBrowser.js
index e2eaf0f..4f89bd2 100644
--- a/lib/common/plugin/InAppBrowser.js
+++ b/lib/common/plugin/InAppBrowser.js
@@ -21,6 +21,7 @@
 
 var exec = require('cordova/exec');
 var channel = require('cordova/channel');
+var modulemapper = require('cordova/modulemapper');
 
 function InAppBrowser() {
    this.channels = {
@@ -29,7 +30,6 @@ function InAppBrowser() {
         'loaderror' : channel.create('loaderror'),
         'exit' : channel.create('exit')
    };
-   this.originalWindowOpen = window.open;
 }
 
 InAppBrowser.prototype = {
@@ -87,11 +87,13 @@ module.exports = function(strUrl, strWindowName, strWindowFeatures) {
        iab._eventHandler(eventname);
     };
 
+    // Don't catch calls that write to existing frames (e.g. named iframes).
     if (window.frames && window.frames[strWindowName]) {
-        return this.originalWindowOpen(strUrl, strWindowName, strWindowFeatures);
-    } else {
-        exec(cb, cb, "InAppBrowser", "open", [strUrl, strWindowName, strWindowFeatures]);
-        return iab;
+        var origOpenFunc = modulemapper.getOriginalSymbol(window, 'open');
+        return origOpenFunc.apply(window, arguments);
     }
+
+    exec(cb, cb, "InAppBrowser", "open", [strUrl, strWindowName, strWindowFeatures]);
+    return iab;
 };
 


Mime
View raw message