mirror of
https://github.com/shuto-cn/cordova-plugin-inappbrowser.git
synced 2026-02-06 00:00:05 +08:00
Compare commits
24 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81aa8ba5a9 | ||
|
|
2cd868e99f | ||
|
|
6aca3f7fb4 | ||
|
|
7b42f3e105 | ||
|
|
82bbe29986 | ||
|
|
785fc4c83d | ||
|
|
d4338bd64a | ||
|
|
0411a287b8 | ||
|
|
416b05c1e5 | ||
|
|
9a15737577 | ||
|
|
7b6f95964a | ||
|
|
1e16c50b1a | ||
|
|
80feff6cf8 | ||
|
|
ba345b0159 | ||
|
|
855394628e | ||
|
|
79b1bb61a0 | ||
|
|
4376ddabcd | ||
|
|
82d496ae5c | ||
|
|
81bec09526 | ||
|
|
8805f5d46a | ||
|
|
8810c6a8a0 | ||
|
|
2b59941514 | ||
|
|
84dfb09edd | ||
|
|
e3db974080 |
@@ -12,12 +12,12 @@ addons:
|
||||
env:
|
||||
global:
|
||||
- SAUCE_USERNAME=snay
|
||||
- TRAVIS_NODE_VERSION=6
|
||||
- TRAVIS_NODE_VERSION=8
|
||||
- ANDROID_API_LEVEL=28
|
||||
- ANDROID_BUILD_TOOLS_VERSION=28.0.3
|
||||
|
||||
language: node_js
|
||||
node_js: 6
|
||||
node_js: 8
|
||||
|
||||
# yaml anchor/alias: https://medium.com/@tommyvn/travis-yml-dry-with-anchors-8b6a3ac1b027
|
||||
|
||||
|
||||
@@ -256,7 +256,7 @@ function loadStopCallBack() {
|
||||
|
||||
if (inAppBrowserRef != undefined) {
|
||||
|
||||
inAppBrowserRef.insertCSS({ code: "body{font-size: 25px;" });
|
||||
inAppBrowserRef.insertCSS({ code: "body{font-size: 25px;}" });
|
||||
|
||||
inAppBrowserRef.executeScript({ code: "\
|
||||
var message = 'this is the message';\
|
||||
@@ -621,7 +621,7 @@ function loadStopCallBack() {
|
||||
|
||||
if (inAppBrowserRef != undefined) {
|
||||
|
||||
inAppBrowserRef.insertCSS({ code: "body{font-size: 25px;" });
|
||||
inAppBrowserRef.insertCSS({ code: "body{font-size: 25px;}" });
|
||||
|
||||
$('#status-message').text("");
|
||||
|
||||
|
||||
@@ -20,6 +20,15 @@
|
||||
-->
|
||||
# Release Notes
|
||||
|
||||
### 3.2.0 (Jan 04, 2020)
|
||||
* [GH-503](https://github.com/apache/cordova-plugin-inappbrowser/pull/503) Defensive code to prevent NULL reference exceptions for async
|
||||
* [GH-584](https://github.com/apache/cordova-plugin-inappbrowser/pull/584) Add compile-time decision for disabling UIWebView
|
||||
* [GH-524](https://github.com/apache/cordova-plugin-inappbrowser/pull/524) Replace "beforeload" with BEFORELOAD
|
||||
* [GH-568](https://github.com/apache/cordova-plugin-inappbrowser/pull/568) Update missing closed brace to the insert.CSS
|
||||
* [GH-401](https://github.com/apache/cordova-plugin-inappbrowser/pull/401) Move createIframeBridge to injectDeferredObject
|
||||
* [GH-534](https://github.com/apache/cordova-plugin-inappbrowser/pull/534) Fix `InAppBrowser` not opening on **iOS** 13
|
||||
* ci(travis) Upgrade to node8
|
||||
|
||||
### 3.1.0 (Jun 27, 2019)
|
||||
|
||||
- chore: fix repo and issue urls and license in package.json and plugin.xml ([`8edfb9e`](https://github.com/apache/cordova-plugin-inappbrowser/commit/8edfb9e))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cordova-plugin-inappbrowser",
|
||||
"version": "3.1.0",
|
||||
"version": "3.2.0",
|
||||
"description": "Cordova InAppBrowser Plugin",
|
||||
"types": "./types/index.d.ts",
|
||||
"cordova": {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
||||
id="cordova-plugin-inappbrowser"
|
||||
version="3.1.0">
|
||||
version="3.2.0">
|
||||
|
||||
<name>InAppBrowser</name>
|
||||
<description>Cordova InAppBrowser Plugin</description>
|
||||
|
||||
@@ -313,7 +313,9 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
this.cordova.getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
dialog.show();
|
||||
if (dialog != null) {
|
||||
dialog.show();
|
||||
}
|
||||
}
|
||||
});
|
||||
PluginResult pluginResult = new PluginResult(PluginResult.Status.OK);
|
||||
@@ -324,7 +326,9 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
this.cordova.getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
dialog.hide();
|
||||
if (dialog != null) {
|
||||
dialog.hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
PluginResult pluginResult = new PluginResult(PluginResult.Status.OK);
|
||||
@@ -437,7 +441,7 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
if (option.hasMoreElements()) {
|
||||
String key = option.nextToken();
|
||||
String value = option.nextToken();
|
||||
if (!customizableOptions.contains(key)){
|
||||
if (!customizableOptions.contains(key)) {
|
||||
value = value.equals("yes") || value.equals("no") ? value : "yes";
|
||||
}
|
||||
map.put(key, value);
|
||||
@@ -616,7 +620,7 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
return this.showLocationBar;
|
||||
}
|
||||
|
||||
private InAppBrowser getInAppBrowser(){
|
||||
private InAppBrowser getInAppBrowser() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -730,7 +734,7 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
return value;
|
||||
}
|
||||
|
||||
private View createCloseButton(int id){
|
||||
private View createCloseButton(int id) {
|
||||
View _close;
|
||||
Resources activityRes = cordova.getActivity().getResources();
|
||||
|
||||
@@ -906,9 +910,9 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
// Footer
|
||||
RelativeLayout footer = new RelativeLayout(cordova.getActivity());
|
||||
int _footerColor;
|
||||
if(footerColor != ""){
|
||||
if(footerColor != "") {
|
||||
_footerColor = Color.parseColor(footerColor);
|
||||
}else{
|
||||
} else {
|
||||
_footerColor = android.graphics.Color.LTGRAY;
|
||||
}
|
||||
footer.setBackgroundColor(_footerColor);
|
||||
@@ -1065,12 +1069,14 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
lp.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
lp.height = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
|
||||
dialog.setContentView(main);
|
||||
dialog.show();
|
||||
dialog.getWindow().setAttributes(lp);
|
||||
if (dialog != null) {
|
||||
dialog.setContentView(main);
|
||||
dialog.show();
|
||||
dialog.getWindow().setAttributes(lp);
|
||||
}
|
||||
// the goal of openhidden is to load the url and not display it
|
||||
// Show() needs to be called to cause the URL to be loaded
|
||||
if(openWindowHidden) {
|
||||
if (openWindowHidden && dialog != null) {
|
||||
dialog.hide();
|
||||
}
|
||||
}
|
||||
@@ -1208,26 +1214,26 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
|
||||
if (beforeload.equals("yes") && method == null) {
|
||||
useBeforeload = true;
|
||||
}else if(beforeload.equals("yes")
|
||||
} else if(beforeload.equals("yes")
|
||||
//TODO handle POST requests then this condition can be removed:
|
||||
&& !method.equals("POST"))
|
||||
{
|
||||
useBeforeload = true;
|
||||
}else if(beforeload.equals("get") && (method == null || method.equals("GET"))){
|
||||
} else if(beforeload.equals("get") && (method == null || method.equals("GET"))) {
|
||||
useBeforeload = true;
|
||||
}else if(beforeload.equals("post") && (method == null || method.equals("POST"))){
|
||||
} else if(beforeload.equals("post") && (method == null || method.equals("POST"))) {
|
||||
//TODO handle POST requests
|
||||
errorMessage = "beforeload doesn't yet support POST requests";
|
||||
}
|
||||
|
||||
// On first URL change, initiate JS callback. Only after the beforeload event, continue.
|
||||
if (useBeforeload && this.waitForBeforeload) {
|
||||
if(sendBeforeLoad(url, method)){
|
||||
if(sendBeforeLoad(url, method)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if(errorMessage != null){
|
||||
if(errorMessage != null) {
|
||||
try {
|
||||
LOG.e(LOG_TAG, errorMessage);
|
||||
JSONObject obj = new JSONObject();
|
||||
@@ -1236,7 +1242,7 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
obj.put("code", -1);
|
||||
obj.put("message", errorMessage);
|
||||
sendUpdate(obj, true, PluginResult.Status.ERROR);
|
||||
}catch(Exception e){
|
||||
} catch(Exception e) {
|
||||
LOG.e(LOG_TAG, "Error sending loaderror for " + url + ": " + e.toString());
|
||||
}
|
||||
}
|
||||
@@ -1322,12 +1328,12 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
return override;
|
||||
}
|
||||
|
||||
private boolean sendBeforeLoad(String url, String method){
|
||||
private boolean sendBeforeLoad(String url, String method) {
|
||||
try {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("type", "beforeload");
|
||||
obj.put("type", BEFORELOAD);
|
||||
obj.put("url", url);
|
||||
if(method != null){
|
||||
if(method != null) {
|
||||
obj.put("method", method);
|
||||
}
|
||||
sendUpdate(obj, true);
|
||||
@@ -1365,7 +1371,7 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
return shouldInterceptRequest(request.getUrl().toString(), super.shouldInterceptRequest(view, request), request.getMethod());
|
||||
}
|
||||
|
||||
public WebResourceResponse shouldInterceptRequest(String url, WebResourceResponse response, String method){
|
||||
public WebResourceResponse shouldInterceptRequest(String url, WebResourceResponse response, String method) {
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -1406,13 +1412,11 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
super.onPageFinished(view, url);
|
||||
|
||||
// Set the namespace for postMessage()
|
||||
if (Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1){
|
||||
if (Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
||||
injectDeferredObject("window.webkit={messageHandlers:{cordova_iab:cordova_iab}}", null);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,9 @@
|
||||
|
||||
#import "CDVInAppBrowser.h"
|
||||
#import "CDVInAppBrowserOptions.h"
|
||||
#if !WK_WEB_VIEW_ONLY
|
||||
#import "CDVUIInAppBrowser.h"
|
||||
#endif
|
||||
#import "CDVWKInAppBrowser.h"
|
||||
#import <Cordova/CDVPluginResult.h>
|
||||
|
||||
@@ -49,86 +51,122 @@
|
||||
return;
|
||||
}
|
||||
self.usewkwebview = browserOptions.usewkwebview;
|
||||
if(self.usewkwebview){
|
||||
[[CDVWKInAppBrowser getInstance] open:command];
|
||||
}else{
|
||||
[[CDVUIInAppBrowser getInstance] open:command];
|
||||
}
|
||||
#if WK_WEB_VIEW_ONLY
|
||||
[[CDVWKInAppBrowser getInstance] open:command];
|
||||
#else
|
||||
if(self.usewkwebview){
|
||||
[[CDVWKInAppBrowser getInstance] open:command];
|
||||
}else{
|
||||
[[CDVUIInAppBrowser getInstance] open:command];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void)close:(CDVInvokedUrlCommand*)command
|
||||
{
|
||||
if(self.usewkwebview){
|
||||
[[CDVWKInAppBrowser getInstance] close:command];
|
||||
}else{
|
||||
[[CDVUIInAppBrowser getInstance] close:command];
|
||||
}
|
||||
#if WK_WEB_VIEW_ONLY
|
||||
[[CDVWKInAppBrowser getInstance] close:command];
|
||||
#else
|
||||
if(self.usewkwebview){
|
||||
[[CDVWKInAppBrowser getInstance] close:command];
|
||||
}else{
|
||||
[[CDVUIInAppBrowser getInstance] close:command];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
- (void)show:(CDVInvokedUrlCommand*)command
|
||||
{
|
||||
if(self.usewkwebview){
|
||||
[[CDVWKInAppBrowser getInstance] show:command];
|
||||
}else{
|
||||
[[CDVUIInAppBrowser getInstance] show:command];
|
||||
}
|
||||
#if WK_WEB_VIEW_ONLY
|
||||
[[CDVWKInAppBrowser getInstance] show:command];
|
||||
#else
|
||||
if(self.usewkwebview){
|
||||
[[CDVWKInAppBrowser getInstance] show:command];
|
||||
}else{
|
||||
[[CDVUIInAppBrowser getInstance] show:command];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void)hide:(CDVInvokedUrlCommand*)command
|
||||
{
|
||||
if(self.usewkwebview){
|
||||
[[CDVWKInAppBrowser getInstance] hide:command];
|
||||
}else{
|
||||
[[CDVUIInAppBrowser getInstance] hide:command];
|
||||
}
|
||||
#if WK_WEB_VIEW_ONLY
|
||||
[[CDVWKInAppBrowser getInstance] hide:command];
|
||||
#else
|
||||
if(self.usewkwebview){
|
||||
[[CDVWKInAppBrowser getInstance] hide:command];
|
||||
}else{
|
||||
[[CDVUIInAppBrowser getInstance] hide:command];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
- (void)injectScriptCode:(CDVInvokedUrlCommand*)command
|
||||
{
|
||||
if(self.usewkwebview){
|
||||
[[CDVWKInAppBrowser getInstance] injectScriptCode:command];
|
||||
}else{
|
||||
[[CDVUIInAppBrowser getInstance] injectScriptCode:command];
|
||||
}
|
||||
#if WK_WEB_VIEW_ONLY
|
||||
[[CDVWKInAppBrowser getInstance] injectScriptCode:command];
|
||||
#else
|
||||
if(self.usewkwebview){
|
||||
[[CDVWKInAppBrowser getInstance] injectScriptCode:command];
|
||||
}else{
|
||||
[[CDVUIInAppBrowser getInstance] injectScriptCode:command];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void)injectScriptFile:(CDVInvokedUrlCommand*)command
|
||||
{
|
||||
if(self.usewkwebview){
|
||||
[[CDVWKInAppBrowser getInstance] injectScriptFile:command];
|
||||
}else{
|
||||
[[CDVUIInAppBrowser getInstance] injectScriptFile:command];
|
||||
}
|
||||
#if WK_WEB_VIEW_ONLY
|
||||
[[CDVWKInAppBrowser getInstance] injectScriptFile:command];
|
||||
#else
|
||||
if(self.usewkwebview){
|
||||
[[CDVWKInAppBrowser getInstance] injectScriptFile:command];
|
||||
}else{
|
||||
[[CDVUIInAppBrowser getInstance] injectScriptFile:command];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void)injectStyleCode:(CDVInvokedUrlCommand*)command
|
||||
{
|
||||
if(self.usewkwebview){
|
||||
[[CDVWKInAppBrowser getInstance] injectStyleCode:command];
|
||||
}else{
|
||||
[[CDVUIInAppBrowser getInstance] injectStyleCode:command];
|
||||
}
|
||||
#if WK_WEB_VIEW_ONLY
|
||||
[[CDVWKInAppBrowser getInstance] injectStyleCode:command];
|
||||
#else
|
||||
if(self.usewkwebview){
|
||||
[[CDVWKInAppBrowser getInstance] injectStyleCode:command];
|
||||
}else{
|
||||
[[CDVUIInAppBrowser getInstance] injectStyleCode:command];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void)injectStyleFile:(CDVInvokedUrlCommand*)command
|
||||
{
|
||||
if(self.usewkwebview){
|
||||
[[CDVWKInAppBrowser getInstance] injectStyleFile:command];
|
||||
}else{
|
||||
[[CDVUIInAppBrowser getInstance] injectStyleFile:command];
|
||||
}
|
||||
#if WK_WEB_VIEW_ONLY
|
||||
[[CDVWKInAppBrowser getInstance] injectStyleFile:command];
|
||||
#else
|
||||
if(self.usewkwebview){
|
||||
[[CDVWKInAppBrowser getInstance] injectStyleFile:command];
|
||||
}else{
|
||||
[[CDVUIInAppBrowser getInstance] injectStyleFile:command];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void)loadAfterBeforeload:(CDVInvokedUrlCommand*)command
|
||||
{
|
||||
if(self.usewkwebview){
|
||||
[[CDVWKInAppBrowser getInstance] loadAfterBeforeload:command];
|
||||
}else{
|
||||
[[CDVUIInAppBrowser getInstance] loadAfterBeforeload:command];
|
||||
}
|
||||
#if WK_WEB_VIEW_ONLY
|
||||
[[CDVWKInAppBrowser getInstance] loadAfterBeforeload:command];
|
||||
#else
|
||||
if(self.usewkwebview){
|
||||
[[CDVWKInAppBrowser getInstance] loadAfterBeforeload:command];
|
||||
}else{
|
||||
[[CDVUIInAppBrowser getInstance] loadAfterBeforeload:command];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
@end
|
||||
@@ -17,6 +17,8 @@
|
||||
under the License.
|
||||
*/
|
||||
|
||||
#if !WK_WEB_VIEW_ONLY
|
||||
|
||||
#import <Cordova/CDVPlugin.h>
|
||||
#import <Cordova/CDVInvokedUrlCommand.h>
|
||||
#import <Cordova/CDVScreenOrientationDelegate.h>
|
||||
@@ -89,3 +91,5 @@
|
||||
- (id)initWithUserAgent:(NSString*)userAgent prevUserAgent:(NSString*)prevUserAgent browserOptions: (CDVInAppBrowserOptions*) browserOptions;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -17,6 +17,8 @@
|
||||
under the License.
|
||||
*/
|
||||
|
||||
#if !WK_WEB_VIEW_ONLY
|
||||
|
||||
#import "CDVUIInAppBrowser.h"
|
||||
#import <Cordova/CDVPluginResult.h>
|
||||
#import <Cordova/CDVUserAgentUtil.h>
|
||||
@@ -363,6 +365,7 @@ static CDVUIInAppBrowser* instance = nil;
|
||||
|
||||
- (void)injectDeferredObject:(NSString*)source withWrapper:(NSString*)jsWrapper
|
||||
{
|
||||
[self createIframeBridge];
|
||||
if (jsWrapper != nil) {
|
||||
NSData* jsonData = [NSJSONSerialization dataWithJSONObject:@[source] options:0 error:nil];
|
||||
NSString* sourceArrayString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
|
||||
@@ -565,7 +568,6 @@ static CDVUIInAppBrowser* instance = nil;
|
||||
|
||||
- (void)webViewDidFinishLoad:(UIWebView*)theWebView
|
||||
{
|
||||
[self createIframeBridge];
|
||||
if (self.callbackId != nil) {
|
||||
// TODO: It would be more useful to return the URL the page is actually on (e.g. if it's been redirected).
|
||||
NSString* url = [self.inAppBrowserViewController.currentURL absoluteString];
|
||||
@@ -1126,4 +1128,4 @@ static CDVUIInAppBrowser* instance = nil;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
#endif
|
||||
@@ -27,6 +27,8 @@
|
||||
@class CDVWKInAppBrowserViewController;
|
||||
|
||||
@interface CDVWKInAppBrowser : CDVPlugin {
|
||||
UIWindow * tmpWindow;
|
||||
|
||||
@private
|
||||
NSString* _beforeload;
|
||||
BOOL _waitForBeforeload;
|
||||
|
||||
@@ -80,6 +80,7 @@ static CDVWKInAppBrowser* instance = nil;
|
||||
NSLog(@"IAB.close() called but it was already closed.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Things are cleaned up in browserExit.
|
||||
[self.inAppBrowserViewController close];
|
||||
}
|
||||
@@ -275,7 +276,9 @@ static CDVWKInAppBrowser* instance = nil;
|
||||
_waitForBeforeload = ![_beforeload isEqualToString:@""];
|
||||
|
||||
[self.inAppBrowserViewController navigateTo:url];
|
||||
[self show:nil withNoAnimate:browserOptions.hidden];
|
||||
if (!browserOptions.hidden) {
|
||||
[self show:nil withNoAnimate:browserOptions.hidden];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)show:(CDVInvokedUrlCommand*)command{
|
||||
@@ -314,19 +317,21 @@ static CDVWKInAppBrowser* instance = nil;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (weakSelf.inAppBrowserViewController != nil) {
|
||||
float osVersion = [[[UIDevice currentDevice] systemVersion] floatValue];
|
||||
CGRect frame = [[UIScreen mainScreen] bounds];
|
||||
if(initHidden && osVersion < 11){
|
||||
frame.origin.x = -10000;
|
||||
__strong __typeof(weakSelf) strongSelf = weakSelf;
|
||||
if (!strongSelf->tmpWindow) {
|
||||
CGRect frame = [[UIScreen mainScreen] bounds];
|
||||
if(initHidden && osVersion < 11){
|
||||
frame.origin.x = -10000;
|
||||
}
|
||||
strongSelf->tmpWindow = [[UIWindow alloc] initWithFrame:frame];
|
||||
}
|
||||
|
||||
UIWindow *tmpWindow = [[UIWindow alloc] initWithFrame:frame];
|
||||
UIViewController *tmpController = [[UIViewController alloc] init];
|
||||
|
||||
[tmpWindow setRootViewController:tmpController];
|
||||
[tmpWindow setWindowLevel:UIWindowLevelNormal];
|
||||
|
||||
|
||||
[strongSelf->tmpWindow setRootViewController:tmpController];
|
||||
[strongSelf->tmpWindow setWindowLevel:UIWindowLevelNormal];
|
||||
|
||||
if(!initHidden || osVersion < 11){
|
||||
[tmpWindow makeKeyAndVisible];
|
||||
[self->tmpWindow makeKeyAndVisible];
|
||||
}
|
||||
[tmpController presentViewController:nav animated:!noAnimate completion:nil];
|
||||
}
|
||||
@@ -335,6 +340,10 @@ static CDVWKInAppBrowser* instance = nil;
|
||||
|
||||
- (void)hide:(CDVInvokedUrlCommand*)command
|
||||
{
|
||||
// Set tmpWindow to hidden to make main webview responsive to touch again
|
||||
// https://stackoverflow.com/questions/4544489/how-to-remove-a-uiwindow
|
||||
self->tmpWindow.hidden = YES;
|
||||
|
||||
if (self.inAppBrowserViewController == nil) {
|
||||
NSLog(@"Tried to hide IAB after it was closed.");
|
||||
return;
|
||||
@@ -690,6 +699,10 @@ static CDVWKInAppBrowser* instance = nil;
|
||||
// Set navigationDelegate to nil to ensure no callbacks are received from it.
|
||||
self.inAppBrowserViewController.navigationDelegate = nil;
|
||||
self.inAppBrowserViewController = nil;
|
||||
|
||||
// Set tmpWindow to hidden to make main webview responsive to touch again
|
||||
// Based on https://stackoverflow.com/questions/4544489/how-to-remove-a-uiwindow
|
||||
self->tmpWindow.hidden = YES;
|
||||
|
||||
if (IsAtLeastiOSVersion(@"7.0")) {
|
||||
if (_previousStatusBarStyle != -1) {
|
||||
@@ -786,7 +799,7 @@ BOOL isExiting = FALSE;
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000
|
||||
if (@available(iOS 11.0, *)) {
|
||||
[self.webView.scrollView setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentNever];
|
||||
[self.webView.scrollView setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentNever];
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cordova-plugin-inappbrowser-tests",
|
||||
"version": "3.1.0",
|
||||
"version": "3.2.0",
|
||||
"description": "",
|
||||
"cordova": {
|
||||
"id": "cordova-plugin-inappbrowser-tests",
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
||||
id="cordova-plugin-inappbrowser-tests"
|
||||
version="3.1.0">
|
||||
version="3.2.0">
|
||||
<name>Cordova InAppBrowser Plugin Tests</name>
|
||||
<license>Apache 2.0</license>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user