cordova-plugin-inappbrowser-patch 6.0.1 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +2 -2
- package/README.md +51 -24
- package/RELEASENOTES.md +4 -4
- package/eslint.config.js +45 -0
- package/licence_checker.yml +19 -0
- package/package.json +12 -7
- package/plugin.xml +20 -19
- package/src/android/InAppBrowser.java +20 -18
- package/src/android/InAppBrowserDialog.java +18 -17
- package/src/android/InAppChromeClient.java +18 -17
- package/src/browser/InAppBrowserProxy.js +24 -26
- package/src/ios/CDVInAppBrowserNavigationController.h +16 -20
- package/src/ios/CDVInAppBrowserNavigationController.m +23 -50
- package/src/ios/CDVInAppBrowserOptions.h +27 -27
- package/src/ios/CDVInAppBrowserOptions.m +25 -25
- package/src/ios/CDVWKInAppBrowser.h +56 -49
- package/src/ios/CDVWKInAppBrowser.m +492 -567
- package/src/ios/CDVWKInAppBrowserUIDelegate.h +20 -20
- package/src/ios/CDVWKInAppBrowserUIDelegate.m +43 -43
- package/types/index.d.ts +7 -5
- package/www/inappbrowser.js +18 -20
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
/**
|
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
|
4
|
+
distributed with this work for additional information
|
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
|
7
|
+
"License"); you may not use this file except in compliance
|
|
8
|
+
with the License. You may obtain a copy of the License at
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
|
13
|
+
software distributed under the License is distributed on an
|
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
KIND, either express or implied. See the License for the
|
|
16
|
+
specific language governing permissions and limitations
|
|
17
|
+
under the License.
|
|
18
|
+
*/
|
|
19
19
|
|
|
20
20
|
#import <WebKit/WebKit.h>
|
|
21
21
|
|
|
22
22
|
@interface CDVWKInAppBrowserUIDelegate : NSObject <WKUIDelegate>{
|
|
23
23
|
@private
|
|
24
|
-
UIViewController*
|
|
24
|
+
UIViewController *_viewController;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
@property (nonatomic, copy) NSString*
|
|
27
|
+
@property (nonatomic, copy) NSString *title;
|
|
28
28
|
|
|
29
|
-
- (instancetype)initWithTitle:(NSString*)title;
|
|
30
|
-
-(void)
|
|
29
|
+
- (instancetype)initWithTitle:(NSString *)title;
|
|
30
|
+
- (void)setViewController:(UIViewController *)viewController;
|
|
31
31
|
|
|
32
32
|
@end
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
/**
|
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
|
4
|
+
distributed with this work for additional information
|
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
|
7
|
+
"License"); you may not use this file except in compliance
|
|
8
|
+
with the License. You may obtain a copy of the License at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
|
13
|
+
software distributed under the License is distributed on an
|
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
KIND, either express or implied. See the License for the
|
|
16
|
+
specific language governing permissions and limitations
|
|
17
|
+
under the License.
|
|
18
|
+
*/
|
|
19
19
|
|
|
20
20
|
#import "CDVWKInAppBrowserUIDelegate.h"
|
|
21
21
|
|
|
22
22
|
@implementation CDVWKInAppBrowserUIDelegate
|
|
23
23
|
|
|
24
|
-
- (instancetype)initWithTitle:(NSString*)title
|
|
24
|
+
- (instancetype)initWithTitle:(NSString *)title
|
|
25
25
|
{
|
|
26
26
|
self = [super init];
|
|
27
27
|
if (self) {
|
|
@@ -31,16 +31,16 @@
|
|
|
31
31
|
return self;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
- (void)
|
|
35
|
-
|
|
34
|
+
- (void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message
|
|
35
|
+
initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(void))completionHandler
|
|
36
36
|
{
|
|
37
|
-
UIAlertController*
|
|
37
|
+
UIAlertController *alert = [UIAlertController alertControllerWithTitle:self.title
|
|
38
38
|
message:message
|
|
39
39
|
preferredStyle:UIAlertControllerStyleAlert];
|
|
40
40
|
|
|
41
|
-
UIAlertAction*
|
|
41
|
+
UIAlertAction *ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
|
|
42
42
|
style:UIAlertActionStyleDefault
|
|
43
|
-
handler:^(UIAlertAction*
|
|
43
|
+
handler:^(UIAlertAction *action)
|
|
44
44
|
{
|
|
45
45
|
completionHandler();
|
|
46
46
|
[alert dismissViewControllerAnimated:YES completion:nil];
|
|
@@ -51,16 +51,16 @@
|
|
|
51
51
|
[[self getViewController] presentViewController:alert animated:YES completion:nil];
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
- (void)
|
|
55
|
-
|
|
54
|
+
- (void)webView:(WKWebView *)webView runJavaScriptConfirmPanelWithMessage:(NSString *)message
|
|
55
|
+
initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(BOOL result))completionHandler
|
|
56
56
|
{
|
|
57
|
-
UIAlertController*
|
|
57
|
+
UIAlertController *alert = [UIAlertController alertControllerWithTitle:self.title
|
|
58
58
|
message:message
|
|
59
59
|
preferredStyle:UIAlertControllerStyleAlert];
|
|
60
60
|
|
|
61
|
-
UIAlertAction*
|
|
61
|
+
UIAlertAction *ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
|
|
62
62
|
style:UIAlertActionStyleDefault
|
|
63
|
-
handler:^(UIAlertAction*
|
|
63
|
+
handler:^(UIAlertAction *action)
|
|
64
64
|
{
|
|
65
65
|
completionHandler(YES);
|
|
66
66
|
[alert dismissViewControllerAnimated:YES completion:nil];
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
|
|
69
69
|
[alert addAction:ok];
|
|
70
70
|
|
|
71
|
-
UIAlertAction*
|
|
71
|
+
UIAlertAction *cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel")
|
|
72
72
|
style:UIAlertActionStyleDefault
|
|
73
|
-
handler:^(UIAlertAction*
|
|
73
|
+
handler:^(UIAlertAction *action)
|
|
74
74
|
{
|
|
75
75
|
completionHandler(NO);
|
|
76
76
|
[alert dismissViewControllerAnimated:YES completion:nil];
|
|
@@ -80,46 +80,46 @@
|
|
|
80
80
|
[[self getViewController] presentViewController:alert animated:YES completion:nil];
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
- (void)
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
- (void)webView:(WKWebView *)webView runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt
|
|
84
|
+
defaultText:(NSString *)defaultText initiatedByFrame:(WKFrameInfo *)frame
|
|
85
|
+
completionHandler:(void (^)(NSString *result))completionHandler
|
|
86
86
|
{
|
|
87
|
-
UIAlertController*
|
|
87
|
+
UIAlertController *alert = [UIAlertController alertControllerWithTitle:self.title
|
|
88
88
|
message:prompt
|
|
89
89
|
preferredStyle:UIAlertControllerStyleAlert];
|
|
90
90
|
|
|
91
|
-
UIAlertAction*
|
|
91
|
+
UIAlertAction *ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
|
|
92
92
|
style:UIAlertActionStyleDefault
|
|
93
|
-
handler:^(UIAlertAction*
|
|
93
|
+
handler:^(UIAlertAction *action)
|
|
94
94
|
{
|
|
95
|
-
completionHandler(((UITextField*)alert.textFields[0]).text);
|
|
95
|
+
completionHandler(((UITextField *)alert.textFields[0]).text);
|
|
96
96
|
[alert dismissViewControllerAnimated:YES completion:nil];
|
|
97
97
|
}];
|
|
98
98
|
|
|
99
99
|
[alert addAction:ok];
|
|
100
100
|
|
|
101
|
-
UIAlertAction*
|
|
101
|
+
UIAlertAction *cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel")
|
|
102
102
|
style:UIAlertActionStyleDefault
|
|
103
|
-
handler:^(UIAlertAction*
|
|
103
|
+
handler:^(UIAlertAction *action)
|
|
104
104
|
{
|
|
105
105
|
completionHandler(nil);
|
|
106
106
|
[alert dismissViewControllerAnimated:YES completion:nil];
|
|
107
107
|
}];
|
|
108
108
|
[alert addAction:cancel];
|
|
109
109
|
|
|
110
|
-
[alert addTextFieldWithConfigurationHandler:^(UITextField*
|
|
110
|
+
[alert addTextFieldWithConfigurationHandler:^(UITextField *textField) {
|
|
111
111
|
textField.text = defaultText;
|
|
112
112
|
}];
|
|
113
113
|
|
|
114
114
|
[[self getViewController] presentViewController:alert animated:YES completion:nil];
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
-(UIViewController*)
|
|
117
|
+
- (UIViewController *)getViewController
|
|
118
118
|
{
|
|
119
119
|
return _viewController;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
-(void)
|
|
122
|
+
- (void)setViewController:(UIViewController *)viewController
|
|
123
123
|
{
|
|
124
124
|
_viewController = viewController;
|
|
125
125
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -94,14 +94,16 @@ interface InAppBrowserEventListenerObject {
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
interface InAppBrowserEvent extends Event {
|
|
97
|
-
/** the eventname, either loadstart
|
|
97
|
+
/** the eventname, either `loadstart`, `loadstop`, `loaderror`, `exit`, `message`, or `customscheme`. */
|
|
98
98
|
type: string;
|
|
99
99
|
/** the URL that was loaded. */
|
|
100
100
|
url: string;
|
|
101
|
-
/** the error code, only in the case of loaderror
|
|
102
|
-
code
|
|
103
|
-
/** the error message, only in the case of loaderror
|
|
104
|
-
message
|
|
101
|
+
/** the error code, only in the case of `loaderror`. */
|
|
102
|
+
code?: number;
|
|
103
|
+
/** the error message, only in the case of `loaderror`. */
|
|
104
|
+
message?: string;
|
|
105
|
+
/** the message contents, only in the case of `message`. A stringified JSON object. */
|
|
106
|
+
data?: string;
|
|
105
107
|
}
|
|
106
108
|
|
|
107
109
|
interface Cordova {
|
package/www/inappbrowser.js
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
1
|
+
/**
|
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
|
4
|
+
distributed with this work for additional information
|
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
|
7
|
+
"License"); you may not use this file except in compliance
|
|
8
|
+
with the License. You may obtain a copy of the License at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
|
13
|
+
software distributed under the License is distributed on an
|
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
KIND, either express or implied. See the License for the
|
|
16
|
+
specific language governing permissions and limitations
|
|
17
|
+
under the License.
|
|
18
|
+
*/
|
|
21
19
|
|
|
22
20
|
(function () {
|
|
23
21
|
const exec = require('cordova/exec');
|