For both UIWebView and WKWebView implementations on iOS.
<!--
Please make sure the checklist boxes are all checked before submitting the PR. The checklist
is intended as a quick reference, for complete details please see our Contributor Guidelines:
http://cordova.apache.org/contribute/contribute_guidelines.html
Thanks!
-->
### Platforms affected
iOS
### What does this PR do?
Fixes `beforeload` event (introduced by #276) for iOS
### What testing has been done on this change?
Tested both allow & deny loading of URL with both iOS implementations in [test container app](https://github.com/dpa99c/cordova-plugin-inappbrowser-wkwebview-test) (ignore its README).
- To test with UIWebView use options: `beforeload=yes,usewkwebview=no`
- To test with WKWebView use options: `beforeload=yes,usewkwebview=yes`
### Checklist
- [x] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database
- [x] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
- [x] Added automated test coverage as appropriate for this change.
closes#349
### Platforms affected
iOS
### What does this PR do?
fix issue[ #340](https://github.com/apache/cordova-plugin-inappbrowser/issues/340) iOS CDVWKInAppBrowser evaluateJavascript method randomly gets blocked on iOS 12
### What testing has been done on this change?
manual testing
### Checklist
- [x] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database
- [x] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
- [ ] Added automated test coverage as appropriate for this change.
When calling `.open()` with a target of `_system`, the InAppBrowser on iOS is both launching the URL in the system browser AND also broadcasting to open the URL within the app (calling handleOpenURL). The latter behavior is problematic in many circumstances (e.g. when you want to explicitly open a link in a browser which is a universal link handled by the app).
This commit attempts to address this by checking the return value from openURL -- if it does not open the URL successfully, then (and only then) the code falls back to broadcasting the event within the app to handleOpenURL.
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`.