You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sg...@apache.org on 2014/11/13 07:39:11 UTC

[3/6] cordova-plugin-inappbrowser git commit: CB-7692 InAppBrowser local url opening bug in 8.1

CB-7692 InAppBrowser local url opening bug in 8.1

Using ms-appx-web instead of ms-appx


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/d2eaa089
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/d2eaa089
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/d2eaa089

Branch: refs/heads/master
Commit: d2eaa089f84480db44dc2809a92bf24794988afd
Parents: 1bf42c9
Author: daserge <da...@yandex.ru>
Authored: Wed Oct 15 02:52:28 2014 +0400
Committer: sgrebnov <v-...@microsoft.com>
Committed: Wed Nov 12 22:35:09 2014 -0800

----------------------------------------------------------------------
 src/windows/InAppBrowserProxy.js | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/d2eaa089/src/windows/InAppBrowserProxy.js
----------------------------------------------------------------------
diff --git a/src/windows/InAppBrowserProxy.js b/src/windows/InAppBrowserProxy.js
index dd4b0a0..68b5f59 100644
--- a/src/windows/InAppBrowserProxy.js
+++ b/src/windows/InAppBrowserProxy.js
@@ -88,7 +88,10 @@ var IAB = {
         if (target === "_system") {
             url = new Windows.Foundation.Uri(strUrl);
             Windows.System.Launcher.launchUriAsync(url);
-        } else if (target === "_blank") {
+        } else if (target === "_self" || !target) {
+            window.location = strUrl;
+        } else {
+            // "_blank" or anything else
             if (!browserWrap) {
                 browserWrap = document.createElement("div");
                 browserWrap.style.position = "absolute";
@@ -115,15 +118,16 @@ var IAB = {
             popup.style.borderWidth = "0px";
             popup.style.width = "100%";
             popup.style.height = "100%";
+
+            if (isWebViewAvailable) {
+                strUrl = strUrl.replace("ms-appx://", "ms-appx-web://");
+            }
             popup.src = strUrl;
 
             // start listening for navigation events
             attachNavigationEvents(popup, win);
 
             browserWrap.appendChild(popup);
-            
-        } else {
-            window.location = strUrl;
         }
     },
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org