From 282fdb7a400176c8b89fa85a5a7148f7d229b021 Mon Sep 17 00:00:00 2001 From: Piotr Zalewa Date: Thu, 24 Apr 2014 10:51:06 -0400 Subject: [PATCH] not forcing the look of the inAppBrowserWrap and buttons --- doc/index.md | 19 +++++++++++++++++++ src/firefoxos/InAppBrowserProxy.js | 5 +---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/doc/index.md b/doc/index.md index ebc4734..8696c93 100644 --- a/doc/index.md +++ b/doc/index.md @@ -91,6 +91,7 @@ instance, or the system browser. - Amazon Fire OS - Android - BlackBerry 10 +- Firefox OS - iOS - Windows Phone 7 and 8 @@ -99,6 +100,23 @@ instance, or the system browser. var ref = window.open('http://apache.org', '_blank', 'location=yes'); var ref2 = window.open(encodeURI('http://ja.m.wikipedia.org/wiki/ハングル'), '_blank', 'location=yes'); +### Firefox OS Quirks + +As plugin doesn't enforce any design there is a need to add some CSS rules if +opened with `target` `'_blank'`. The rules might look like these + +``` css +.inappbrowser-wrap { + background-color: rgba(0,0,0,0.75); + color: rgba(235,235,235,1.0); +} +.inappbrowser-wrap p { + padding-top: 10px; + text-align: center; +} +``` + + ## InAppBrowser The object returned from a call to `window.open`. @@ -196,6 +214,7 @@ The function is passed an `InAppBrowserEvent` object. - Amazon Fire OS - Android +- Firefox OS - iOS - Windows Phone 7 and 8 diff --git a/src/firefoxos/InAppBrowserProxy.js b/src/firefoxos/InAppBrowserProxy.js index 8ee3736..85ea5b9 100644 --- a/src/firefoxos/InAppBrowserProxy.js +++ b/src/firefoxos/InAppBrowserProxy.js @@ -63,9 +63,8 @@ var IABExecs = { document.body.removeChild(browserWrap); } browserWrap = document.createElement('div'); + browserWrap.classList.add('inappbrowser-wrap'); browserWrap.style.position = 'absolute'; - browserWrap.style.backgroundColor = 'rgba(0,0,0,0.75)'; - browserWrap.style.color = 'rgba(235,235,235,1.0)'; browserWrap.style.width = window.innerWidth + 'px'; browserWrap.style.height = window.innerHeight + 'px'; browserWrap.style.padding = '10px,0,0,0'; @@ -83,8 +82,6 @@ var IABExecs = { var p = document.createElement('p'); p.appendChild(document.createTextNode('close')); // TODO: make all buttons - ← → × - p.style.paddingTop = '10px'; - p.style.textAlign = 'center'; browserWrap.appendChild(p); browserWrap.appendChild(browserElem); document.body.appendChild(browserWrap);