cordova-plugin-inappbrowser-patch 6.0.1

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.
Files changed (33) hide show
  1. package/CONTRIBUTING.md +37 -0
  2. package/LICENSE +202 -0
  3. package/NOTICE +5 -0
  4. package/README.md +722 -0
  5. package/RELEASENOTES.md +801 -0
  6. package/package.json +60 -0
  7. package/plugin.xml +103 -0
  8. package/src/android/InAppBrowser.java +1503 -0
  9. package/src/android/InAppBrowserDialog.java +57 -0
  10. package/src/android/InAppChromeClient.java +190 -0
  11. package/src/android/res/drawable-hdpi/ic_action_next_item.png +0 -0
  12. package/src/android/res/drawable-hdpi/ic_action_previous_item.png +0 -0
  13. package/src/android/res/drawable-hdpi/ic_action_remove.png +0 -0
  14. package/src/android/res/drawable-mdpi/ic_action_next_item.png +0 -0
  15. package/src/android/res/drawable-mdpi/ic_action_previous_item.png +0 -0
  16. package/src/android/res/drawable-mdpi/ic_action_remove.png +0 -0
  17. package/src/android/res/drawable-xhdpi/ic_action_next_item.png +0 -0
  18. package/src/android/res/drawable-xhdpi/ic_action_previous_item.png +0 -0
  19. package/src/android/res/drawable-xhdpi/ic_action_remove.png +0 -0
  20. package/src/android/res/drawable-xxhdpi/ic_action_next_item.png +0 -0
  21. package/src/android/res/drawable-xxhdpi/ic_action_previous_item.png +0 -0
  22. package/src/android/res/drawable-xxhdpi/ic_action_remove.png +0 -0
  23. package/src/browser/InAppBrowserProxy.js +245 -0
  24. package/src/ios/CDVInAppBrowserNavigationController.h +28 -0
  25. package/src/ios/CDVInAppBrowserNavigationController.m +63 -0
  26. package/src/ios/CDVInAppBrowserOptions.h +51 -0
  27. package/src/ios/CDVInAppBrowserOptions.m +90 -0
  28. package/src/ios/CDVWKInAppBrowser.h +80 -0
  29. package/src/ios/CDVWKInAppBrowser.m +1223 -0
  30. package/src/ios/CDVWKInAppBrowserUIDelegate.h +32 -0
  31. package/src/ios/CDVWKInAppBrowserUIDelegate.m +127 -0
  32. package/types/index.d.ts +109 -0
  33. package/www/inappbrowser.js +124 -0
@@ -0,0 +1,90 @@
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
+
20
+ #import "CDVInAppBrowserOptions.h"
21
+
22
+ @implementation CDVInAppBrowserOptions
23
+
24
+ - (id)init
25
+ {
26
+ if (self = [super init]) {
27
+ // default values
28
+ self.location = YES;
29
+ self.toolbar = YES;
30
+ self.closebuttoncaption = nil;
31
+ self.toolbarposition = @"bottom";
32
+ self.cleardata = NO;
33
+ self.clearcache = NO;
34
+ self.clearsessioncache = NO;
35
+ self.hidespinner = NO;
36
+
37
+ self.enableviewportscale = NO;
38
+ self.mediaplaybackrequiresuseraction = NO;
39
+ self.allowinlinemediaplayback = NO;
40
+ self.hidden = NO;
41
+ self.disallowoverscroll = NO;
42
+ self.hidenavigationbuttons = NO;
43
+ self.closebuttoncolor = nil;
44
+ self.lefttoright = false;
45
+ self.toolbarcolor = nil;
46
+ self.toolbartranslucent = YES;
47
+ self.beforeload = @"";
48
+ }
49
+
50
+ return self;
51
+ }
52
+
53
+ + (CDVInAppBrowserOptions*)parseOptions:(NSString*)options
54
+ {
55
+ CDVInAppBrowserOptions* obj = [[CDVInAppBrowserOptions alloc] init];
56
+
57
+ // NOTE: this parsing does not handle quotes within values
58
+ NSArray* pairs = [options componentsSeparatedByString:@","];
59
+
60
+ // parse keys and values, set the properties
61
+ for (NSString* pair in pairs) {
62
+ NSArray* keyvalue = [pair componentsSeparatedByString:@"="];
63
+
64
+ if ([keyvalue count] == 2) {
65
+ NSString* key = [[keyvalue objectAtIndex:0] lowercaseString];
66
+ NSString* value = [keyvalue objectAtIndex:1];
67
+ NSString* value_lc = [value lowercaseString];
68
+
69
+ BOOL isBoolean = [value_lc isEqualToString:@"yes"] || [value_lc isEqualToString:@"no"];
70
+ NSNumberFormatter* numberFormatter = [[NSNumberFormatter alloc] init];
71
+ [numberFormatter setAllowsFloats:YES];
72
+ BOOL isNumber = [numberFormatter numberFromString:value_lc] != nil;
73
+
74
+ // set the property according to the key name
75
+ if ([obj respondsToSelector:NSSelectorFromString(key)]) {
76
+ if (isNumber) {
77
+ [obj setValue:[numberFormatter numberFromString:value_lc] forKey:key];
78
+ } else if (isBoolean) {
79
+ [obj setValue:[NSNumber numberWithBool:[value_lc isEqualToString:@"yes"]] forKey:key];
80
+ } else {
81
+ [obj setValue:value forKey:key];
82
+ }
83
+ }
84
+ }
85
+ }
86
+
87
+ return obj;
88
+ }
89
+
90
+ @end
@@ -0,0 +1,80 @@
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
+
20
+ #import <Cordova/CDVPlugin.h>
21
+ #import <Cordova/CDVInvokedUrlCommand.h>
22
+ #import <Cordova/CDVScreenOrientationDelegate.h>
23
+ #import "CDVWKInAppBrowserUIDelegate.h"
24
+ #import "CDVInAppBrowserOptions.h"
25
+ #import "CDVInAppBrowserNavigationController.h"
26
+
27
+ @class CDVWKInAppBrowserViewController;
28
+
29
+ @interface CDVWKInAppBrowser : CDVPlugin {
30
+ UIWindow * tmpWindow;
31
+
32
+ @private
33
+ NSString* _beforeload;
34
+ BOOL _waitForBeforeload;
35
+ }
36
+
37
+ @property (nonatomic, retain) CDVWKInAppBrowser* instance;
38
+ @property (nonatomic, retain) CDVWKInAppBrowserViewController* inAppBrowserViewController;
39
+ @property (nonatomic, copy) NSString* callbackId;
40
+ @property (nonatomic, copy) NSRegularExpression *callbackIdPattern;
41
+
42
+ + (id) getInstance;
43
+ - (void)open:(CDVInvokedUrlCommand*)command;
44
+ - (void)close:(CDVInvokedUrlCommand*)command;
45
+ - (void)injectScriptCode:(CDVInvokedUrlCommand*)command;
46
+ - (void)show:(CDVInvokedUrlCommand*)command;
47
+ - (void)hide:(CDVInvokedUrlCommand*)command;
48
+ - (void)loadAfterBeforeload:(CDVInvokedUrlCommand*)command;
49
+
50
+ @end
51
+
52
+ @interface CDVWKInAppBrowserViewController : UIViewController <CDVScreenOrientationDelegate,WKNavigationDelegate,WKUIDelegate,WKScriptMessageHandler,UIAdaptivePresentationControllerDelegate>{
53
+ @private
54
+ CDVInAppBrowserOptions *_browserOptions;
55
+ NSDictionary *_settings;
56
+ }
57
+
58
+ @property (nonatomic, strong) IBOutlet WKWebView* webView;
59
+ @property (nonatomic, strong) IBOutlet WKWebViewConfiguration* configuration;
60
+ @property (nonatomic, strong) IBOutlet UIBarButtonItem* closeButton;
61
+ @property (nonatomic, strong) IBOutlet UILabel* addressLabel;
62
+ @property (nonatomic, strong) IBOutlet UIBarButtonItem* backButton;
63
+ @property (nonatomic, strong) IBOutlet UIBarButtonItem* forwardButton;
64
+ @property (nonatomic, strong) IBOutlet UIActivityIndicatorView* spinner;
65
+ @property (nonatomic, strong) IBOutlet UIToolbar* toolbar;
66
+ @property (nonatomic, strong) IBOutlet CDVWKInAppBrowserUIDelegate* webViewUIDelegate;
67
+
68
+ @property (nonatomic, weak) id <CDVScreenOrientationDelegate> orientationDelegate;
69
+ @property (nonatomic, weak) CDVWKInAppBrowser* navigationDelegate;
70
+ @property (nonatomic) NSURL* currentURL;
71
+
72
+ - (void)close;
73
+ - (void)navigateTo:(NSURL*)url;
74
+ - (void)showLocationBar:(BOOL)show;
75
+ - (void)showToolBar:(BOOL)show : (NSString *) toolbarPosition;
76
+ - (void)setCloseButtonTitle:(NSString*)title : (NSString*) colorString : (int) buttonIndex;
77
+
78
+ - (id)initWithBrowserOptions: (CDVInAppBrowserOptions*) browserOptions andSettings:(NSDictionary*) settings;
79
+
80
+ @end