CB-8467
Added support for hiding the web view container. This maintains the browser session without closing it. The browser window can be repeatedly hidden and shown. ** This has only been tested on android and ios ** amazon/android: An additional `hide` action was added to `InAppBrowser#execute`. It is identical to `show`, except that it calls `dialog.hide()` instead. blackberry10: no changes firefoxos: Added a `hide` method that is identical to `show`, indicating it is not supported. ios: Added a `hide` method that is identical to `show`, except that it uses `dismissViewControllerAnimated`. It checks the value of `_previousStatusBarStyle`. If it is `-1`, the method returns with no action performed. If it is not, it is set to `-1.` ubuntu: Added a `hide` method that sets `CordovaWrapper.global.inappbrowser.visible` to `false`. windows: Added a `hide` method that sets `browserWrap.style.display` to `none`. wp: Added a `hide` method that is identical to `show`, except that it sets `browser.Visibility` to `Visibility.Collapsed` and sets `AppBar.IsVisible` to `false`.
This commit is contained in:
@@ -216,6 +216,7 @@ The object returned from a call to `cordova.InAppBrowser.open` when the target i
|
||||
- removeEventListener
|
||||
- close
|
||||
- show
|
||||
- hide
|
||||
- executeScript
|
||||
- insertCSS
|
||||
|
||||
@@ -414,6 +415,27 @@ The function is passed an `InAppBrowserEvent` object.
|
||||
// some time later...
|
||||
ref.show();
|
||||
|
||||
## InAppBrowser.hide
|
||||
|
||||
> Hides the InAppBrowser window. Calling this has no effect if the InAppBrowser was already hidden.
|
||||
|
||||
ref.hide();
|
||||
|
||||
- __ref__: reference to the InAppBrowser window (`InAppBrowser`)
|
||||
|
||||
### Supported Platforms
|
||||
|
||||
- Amazon Fire OS
|
||||
- Android
|
||||
- iOS
|
||||
- Windows 8 and 8.1
|
||||
|
||||
### Quick Example
|
||||
|
||||
var ref = cordova.InAppBrowser.open('http://apache.org', '_blank');
|
||||
// some time later...
|
||||
ref.hide();
|
||||
|
||||
## InAppBrowser.executeScript
|
||||
|
||||
> Injects JavaScript code into the `InAppBrowser` window
|
||||
@@ -683,4 +705,4 @@ iab.open('http://url-that-fails-whitelist.com', '_blank'); // loads in th
|
||||
iab.open('http://url-that-fails-whitelist.com', 'random_string'); // loads in the InAppBrowser
|
||||
iab.open('http://url-that-fails-whitelist.com', 'random_string', 'location=no'); // loads in the InAppBrowser, no location bar
|
||||
|
||||
```
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user