From 11a2acfd7b8c07ece4b03815af7b6f9b0ead318e Mon Sep 17 00:00:00 2001 From: aroberson Date: Fri, 10 Apr 2015 08:53:48 -0500 Subject: [PATCH 1/2] Fixed zIndex issue on Windows 8, 8.1 where InAppBrowser opens behind default app. --- www/windows8/InAppBrowserProxy.js | 1 + 1 file changed, 1 insertion(+) diff --git a/www/windows8/InAppBrowserProxy.js b/www/windows8/InAppBrowserProxy.js index 944284e..34cc902 100644 --- a/www/windows8/InAppBrowserProxy.js +++ b/www/windows8/InAppBrowserProxy.js @@ -62,6 +62,7 @@ var IAB = { browserWrap.style.borderWidth = "40px"; browserWrap.style.borderStyle = "solid"; browserWrap.style.borderColor = "rgba(0,0,0,0.25)"; + browserWrap.style.zIndex = "9999999"; browserWrap.onclick = function () { setTimeout(function () { From 8175122c038773f6119e6da590c69746517b4f68 Mon Sep 17 00:00:00 2001 From: aroberson Date: Mon, 13 Apr 2015 15:33:03 -0500 Subject: [PATCH 2/2] Invoke webview if using local file --- www/windows8/InAppBrowserProxy.js | 49 +++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/www/windows8/InAppBrowserProxy.js b/www/windows8/InAppBrowserProxy.js index 34cc902..42d15d2 100644 --- a/www/windows8/InAppBrowserProxy.js +++ b/www/windows8/InAppBrowserProxy.js @@ -17,13 +17,12 @@ * specific language governing permissions and limitations * under the License. * -*/ + */ /*jslint sloppy:true */ /*global Windows:true, require, document, setTimeout, window, module */ - var cordova = require('cordova'), channel = require('cordova/channel'); @@ -39,9 +38,9 @@ var IAB = { }, show: function (win, lose) { /* empty block, ran out of bacon? - if (browserWrap) { + if (browserWrap) { - }*/ + }*/ }, open: function (win, lose, args) { var strUrl = args[0], @@ -72,20 +71,38 @@ var IAB = { document.body.appendChild(browserWrap); } + var localFile = (strUrl.indexOf('ms-appdata:///') > -1); + if (localFile) { + elem = document.createElement("x-ms-webview"); + elem.style.width = (window.innerWidth - 80) + "px"; + elem.style.height = (window.innerHeight - 80) + "px"; + elem.style.borderWidth = "0px"; + elem.name = "targetFrame"; + elem.src = strUrl; - elem = document.createElement("iframe"); - elem.style.width = (window.innerWidth - 80) + "px"; - elem.style.height = (window.innerHeight - 80) + "px"; - elem.style.borderWidth = "0px"; - elem.name = "targetFrame"; - elem.src = strUrl; + window.addEventListener("resize", function () { + if (browserWrap && elem) { + elem.style.width = (window.innerWidth - 80) + "px"; + elem.style.height = (window.innerHeight - 80) + "px"; + } + }); - window.addEventListener("resize", function () { - if (browserWrap && elem) { - elem.style.width = (window.innerWidth - 80) + "px"; - elem.style.height = (window.innerHeight - 80) + "px"; - } - }); + } else { + elem = document.createElement("iframe"); + elem.style.width = (window.innerWidth - 80) + "px"; + elem.style.height = (window.innerHeight - 80) + "px"; + elem.style.borderWidth = "0px"; + elem.name = "targetFrame"; + elem.src = strUrl; + + + window.addEventListener("resize", function () { + if (browserWrap && elem) { + elem.style.width = (window.innerWidth - 80) + "px"; + elem.style.height = (window.innerHeight - 80) + "px"; + } + }); + } browserWrap.appendChild(elem); } else {