Skip to content

Commit

Permalink
fix wkwebview
Browse files Browse the repository at this point in the history
  • Loading branch information
Tien Nguyen authored and Tien Nguyen committed Jun 14, 2020
1 parent 963d7e8 commit 4ad1ece
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 426 deletions.
21 changes: 12 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-themeablebrowser-wkwebview",
"version": "2.0.0",
"version": "2.1.0",
"description": "Cordova ThemeableBrowser Plugin",
"cordova": {
"id": "cordova-plugin-themeablebrowser-wkwebview",
Expand Down Expand Up @@ -36,15 +36,18 @@
"version": ">=3.1.0"
}
],
"author": {
"name": "Apache Software Foundation"
},
"license": "Apache 2.0",
"gitHead": "23de7bf8f9bacaa0387d2e211e4b26376503ddda",
"readme": "",
"readmeFilename": "README.md",
"author": "Apache Software Foundation",
"license": "MIT",
"bugs": {
"url": "https://github.com/tien271/cordova-plugin-themeablebrowser-wkwebview/issues"
},
"homepage": "https://github.com/tien271/cordova-plugin-themeablebrowser-wkwebview#readme"
"homepage": "https://github.com/tien271/cordova-plugin-themeablebrowser-wkwebview#readme",
"main": "index.js",
"directories": {
"doc": "doc",
"test": "tests"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
}
}
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<plugin
xmlns="http://apache.org/cordova/ns/plugins/1.0"
id="cordova-plugin-themeablebrowser-wkwebview"
version="2.0.0">
version="2.1.0">

<name>ThemeableBrowser</name>
<description>Cordova ThemeableBrowser Plugin</description>
Expand Down
18 changes: 3 additions & 15 deletions src/ios/CDVThemeableBrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
// //#import <Cordova/CDVWebViewDelegate.h>
//#endif

@class CDVWKInAppBrowserViewController;

@interface CDVThemeableBrowserOptions : NSObject {}

@property (nonatomic) BOOL location;
Expand All @@ -45,7 +43,6 @@
@property (nonatomic) NSString* transitionstyle;

@property (nonatomic) BOOL zoom;
@property (nonatomic) BOOL enableviewportscale;
@property (nonatomic) BOOL mediaplaybackrequiresuseraction;
@property (nonatomic) BOOL allowinlinemediaplayback;
@property (nonatomic) BOOL keyboarddisplayrequiresuseraction;
Expand All @@ -56,27 +53,23 @@
@property (nonatomic) NSDictionary* statusbar;
@property (nonatomic) NSDictionary* toolbar;
@property (nonatomic) NSDictionary* title;
@property (nonatomic) NSDictionary* browserProgress;
@property (nonatomic) NSDictionary* backButton;
@property (nonatomic) NSDictionary* reloadButton;
@property (nonatomic) NSDictionary* forwardButton;
@property (nonatomic) NSDictionary* closeButton;
@property (nonatomic) NSDictionary* menu;
@property (nonatomic) NSArray* customButtons;
@property (nonatomic) BOOL backButtonCanClose;
@property (nonatomic) BOOL disableAnimation;
@property (nonatomic) BOOL fullscreen;
@property (nonatomic) BOOL allowsBackForwardNavigationGestures;
@property (nonatomic) NSString* customUserAgent;

@end

@class CDVThemeableBrowserViewController;

@interface CDVThemeableBrowser : CDVPlugin <WKNavigationDelegate> {
BOOL _injectedIframeBridge;
}


@property (nonatomic, retain) CDVThemeableBrowserViewController* themeableBrowserViewController;
@property (nonatomic, copy) NSString* callbackId;
@property (nonatomic, copy) NSRegularExpression *callbackIdPattern;
Expand All @@ -87,13 +80,11 @@
- (void)injectScriptCode:(CDVInvokedUrlCommand*)command;
- (void)show:(CDVInvokedUrlCommand*)command;
- (void)show:(CDVInvokedUrlCommand*)command withAnimation:(BOOL)animated;
- (void)hide:(CDVInvokedUrlCommand*)command;
- (void)reload:(CDVInvokedUrlCommand*)command;
- (void)changeButtonImage:(CDVInvokedUrlCommand*)command;

@end

@interface CDVThemeableBrowserViewController : UIViewController <WKNavigationDelegate,CDVScreenOrientationDelegate, UIActionSheetDelegate, UIGestureRecognizerDelegate, WKScriptMessageHandler, WKUIDelegate>{
@interface CDVThemeableBrowserViewController : UIViewController <WKNavigationDelegate,CDVScreenOrientationDelegate, UIActionSheetDelegate>{
@private
NSString* _userAgent;
NSString* _prevUserAgent;
Expand All @@ -118,12 +109,10 @@
@property (nonatomic, strong) IBOutlet UILabel* addressLabel;
@property (nonatomic, strong) IBOutlet UILabel* titleLabel;
@property (nonatomic, strong) IBOutlet UIButton* backButton;
@property (nonatomic, strong) IBOutlet UIButton* reloadButton;
@property (nonatomic, strong) IBOutlet UIButton* forwardButton;
@property (nonatomic, strong) IBOutlet UIButton* menuButton;
@property (nonatomic, strong) IBOutlet UIActivityIndicatorView* spinner;
@property (nonatomic, strong) IBOutlet UIView* toolbar;
@property (nonatomic, strong) IBOutlet UIProgressView* progressView;

@property (nonatomic, strong) NSArray* leftButtons;
@property (nonatomic, strong) NSArray* rightButtons;
Expand All @@ -132,8 +121,6 @@
@property (nonatomic, weak) CDVThemeableBrowser* navigationDelegate;
@property (nonatomic) NSURL* currentURL;
@property (nonatomic) CGFloat titleOffset;
@property (nonatomic , readonly , getter=loadProgress) CGFloat currentProgress;
- (void)changeButtonImage:(int)buttonIndex buttonProps:(NSDictionary*)buttonProps;

- (void)close;
- (void)reload;
Expand All @@ -153,3 +140,4 @@
@property (nonatomic, weak) id <CDVScreenOrientationDelegate> orientationDelegate;

@end

Loading

0 comments on commit 4ad1ece

Please sign in to comment.