diff --git a/.gitignore b/.gitignore index 52b558e40..0c3111f29 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -#If ignorance is bliss, then somebody knock the smile off my face +#If ignorance is bliss, then somebody knock the smile off my face *.csproj.user *.suo @@ -20,4 +20,5 @@ Thumbs.db - \ No newline at end of file + +package-lock.json diff --git a/README.md b/README.md index c233f3945..ba4af16c7 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ under the License. --> -cordova-plugin-themeablebrowser +cordova-plugin-themeablebrowser-wkwebview =============================== This plugin is a fork of [org.apache.cordova.inappbrowser](https://github.com/apache/cordova-plugin-inappbrowser). It attempts to retain most of the features of the InAppBrowser. In fact, for the full list of features inherited from InAppBrowser, please refer to [InAppBrowser's documentation](https://github.com/apache/cordova-plugin-inappbrowser/blob/master/README.md). @@ -128,7 +128,7 @@ Sample call/config: Installation ------------ - cordova plugin add cordova-plugin-themeablebrowser + cordova plugin add cordova-plugin-themeablebrowser-wkwebview Additional Properties --------------------- diff --git a/package.json b/package.json index e267a4a2e..f7a39eacb 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { - "name": "firefly-cordova-plugin-themeablebrowser", - "version": "0.4.0", + "name": "cordova-plugin-themeablebrowser-wkwebview", + "version": "2.0.0", "description": "Cordova ThemeableBrowser Plugin", "cordova": { - "id": "firefly-cordova-plugin-themeablebrowser", + "id": "cordova-plugin-themeablebrowser-wkwebview", "platforms": [ "android", "amazon-fireos", @@ -18,7 +18,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/imloama/cordova-plugin-themeablebrowser.git" + "url": "git+https://github.com/tien271/cordova-plugin-themeablebrowser-wkwebview.git" }, "keywords": [ "cordova", @@ -44,7 +44,7 @@ "readme": "", "readmeFilename": "README.md", "bugs": { - "url": "https://github.com/imloama/cordova-plugin-themeablebrowser/issues" + "url": "https://github.com/tien271/cordova-plugin-themeablebrowser-wkwebview/issues" }, - "homepage": "https://github.com/imloama/cordova-plugin-themeablebrowser#readme" + "homepage": "https://github.com/tien271/cordova-plugin-themeablebrowser-wkwebview#readme" } diff --git a/plugin.xml b/plugin.xml index cd281d1f4..ac89aec00 100644 --- a/plugin.xml +++ b/plugin.xml @@ -20,8 +20,8 @@ + id="cordova-plugin-themeablebrowser-wkwebview" + version="2.0.0"> ThemeableBrowser Cordova ThemeableBrowser Plugin diff --git a/src/ios/CDVThemeableBrowser.h b/src/ios/CDVThemeableBrowser.h index 32028a9fa..45bef997d 100644 --- a/src/ios/CDVThemeableBrowser.h +++ b/src/ios/CDVThemeableBrowser.h @@ -31,6 +31,8 @@ // //#import //#endif +@class CDVWKInAppBrowserViewController; + @interface CDVThemeableBrowserOptions : NSObject {} @property (nonatomic) BOOL location; @@ -43,6 +45,7 @@ @property (nonatomic) NSString* transitionstyle; @property (nonatomic) BOOL zoom; +@property (nonatomic) BOOL enableviewportscale; @property (nonatomic) BOOL mediaplaybackrequiresuseraction; @property (nonatomic) BOOL allowinlinemediaplayback; @property (nonatomic) BOOL keyboarddisplayrequiresuseraction; @@ -53,7 +56,9 @@ @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; @@ -61,15 +66,17 @@ @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 { - BOOL _injectedIframeBridge; } + @property (nonatomic, retain) CDVThemeableBrowserViewController* themeableBrowserViewController; @property (nonatomic, copy) NSString* callbackId; @property (nonatomic, copy) NSRegularExpression *callbackIdPattern; @@ -80,11 +87,13 @@ - (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 { +@interface CDVThemeableBrowserViewController : UIViewController { @private NSString* _userAgent; NSString* _prevUserAgent; @@ -109,10 +118,12 @@ @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; @@ -121,6 +132,8 @@ @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; @@ -140,4 +153,3 @@ @property (nonatomic, weak) id orientationDelegate; @end - diff --git a/src/ios/CDVThemeableBrowser.m b/src/ios/CDVThemeableBrowser.m index a71421442..da9fa3768 100644 --- a/src/ios/CDVThemeableBrowser.m +++ b/src/ios/CDVThemeableBrowser.m @@ -2033,4 +2033,4 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface } -@end +@end \ No newline at end of file