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.
@@ -1,32 +1,32 @@
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
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
- http://www.apache.org/licenses/LICENSE-2.0
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
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
- */
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* _viewController;
24
+ UIViewController *_viewController;
25
25
  }
26
26
 
27
- @property (nonatomic, copy) NSString* title;
27
+ @property (nonatomic, copy) NSString *title;
28
28
 
29
- - (instancetype)initWithTitle:(NSString*)title;
30
- -(void) setViewController:(UIViewController*) viewController;
29
+ - (instancetype)initWithTitle:(NSString *)title;
30
+ - (void)setViewController:(UIViewController *)viewController;
31
31
 
32
32
  @end
@@ -1,27 +1,27 @@
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
- */
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) webView:(WKWebView*)webView runJavaScriptAlertPanelWithMessage:(NSString*)message
35
- initiatedByFrame:(WKFrameInfo*)frame completionHandler:(void (^)(void))completionHandler
34
+ - (void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message
35
+ initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(void))completionHandler
36
36
  {
37
- UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
37
+ UIAlertController *alert = [UIAlertController alertControllerWithTitle:self.title
38
38
  message:message
39
39
  preferredStyle:UIAlertControllerStyleAlert];
40
40
 
41
- UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
41
+ UIAlertAction *ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
42
42
  style:UIAlertActionStyleDefault
43
- handler:^(UIAlertAction* action)
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) webView:(WKWebView*)webView runJavaScriptConfirmPanelWithMessage:(NSString*)message
55
- initiatedByFrame:(WKFrameInfo*)frame completionHandler:(void (^)(BOOL result))completionHandler
54
+ - (void)webView:(WKWebView *)webView runJavaScriptConfirmPanelWithMessage:(NSString *)message
55
+ initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(BOOL result))completionHandler
56
56
  {
57
- UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
57
+ UIAlertController *alert = [UIAlertController alertControllerWithTitle:self.title
58
58
  message:message
59
59
  preferredStyle:UIAlertControllerStyleAlert];
60
60
 
61
- UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
61
+ UIAlertAction *ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
62
62
  style:UIAlertActionStyleDefault
63
- handler:^(UIAlertAction* action)
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* cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel")
71
+ UIAlertAction *cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel")
72
72
  style:UIAlertActionStyleDefault
73
- handler:^(UIAlertAction* action)
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) webView:(WKWebView*)webView runJavaScriptTextInputPanelWithPrompt:(NSString*)prompt
84
- defaultText:(NSString*)defaultText initiatedByFrame:(WKFrameInfo*)frame
85
- completionHandler:(void (^)(NSString* result))completionHandler
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* alert = [UIAlertController alertControllerWithTitle:self.title
87
+ UIAlertController *alert = [UIAlertController alertControllerWithTitle:self.title
88
88
  message:prompt
89
89
  preferredStyle:UIAlertControllerStyleAlert];
90
90
 
91
- UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
91
+ UIAlertAction *ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
92
92
  style:UIAlertActionStyleDefault
93
- handler:^(UIAlertAction* action)
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* cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel")
101
+ UIAlertAction *cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel")
102
102
  style:UIAlertActionStyleDefault
103
- handler:^(UIAlertAction* action)
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* textField) {
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*) getViewController
117
+ - (UIViewController *)getViewController
118
118
  {
119
119
  return _viewController;
120
120
  }
121
121
 
122
- -(void) setViewController:(UIViewController*) viewController
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, loadstop, loaderror, or exit. */
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: number;
103
- /** the error message, only in the case of loaderror. */
104
- message: string;
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 {
@@ -1,23 +1,21 @@
1
- /*
2
- *
3
- * Licensed to the Apache Software Foundation (ASF) under one
4
- * or more contributor license agreements. See the NOTICE file
5
- * distributed with this work for additional information
6
- * regarding copyright ownership. The ASF licenses this file
7
- * to you under the Apache License, Version 2.0 (the
8
- * "License"); you may not use this file except in compliance
9
- * with the License. You may obtain a copy of the License at
10
- *
11
- * http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing,
14
- * software distributed under the License is distributed on an
15
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- * KIND, either express or implied. See the License for the
17
- * specific language governing permissions and limitations
18
- * under the License.
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');