From d2eaa089f84480db44dc2809a92bf24794988afd Mon Sep 17 00:00:00 2001 From: daserge Date: Wed, 15 Oct 2014 02:52:28 +0400 Subject: [PATCH] CB-7692 InAppBrowser local url opening bug in 8.1 Using ms-appx-web instead of ms-appx --- src/windows/InAppBrowserProxy.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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; } },