Releases: wendux/DSBridge-IOS
3.0.6
refactor code
3.0.5 refactor code
add JSCallback type
3.0.4 add JSCallback block typedef
3.0.3
3.0.2
3.0.1
3.0.0
DSBridge v3.0 change list
DSBridge v3.0 is a milestone, Compared with v2.0.X, we have made a lot of changes. Note that V3.0 is incompatible with V2.0, but v2.0 will continue to maintain. If you are a new user, use >=v3.0
In Java
-
Deprecated:
setJavascriptInterface, useaddJavascriptObject
instead. -
Deprecated:
setJavascriptContextInitedListener,callHandler
can be called at any time. -
Deprecated:
DUIWebView,UIWebView
will not be supported ever. -
New:
addJavascriptObject:(id) object namespace:(NSString *) namespace
-
New:
removeJavascriptObject:NSString * namespace
-
New:
disableJavascriptDialogBlock:(bool) disable
-
New:
hasJavascriptMethod:(NSString *) handlerName methodExistCallback:(void(^ )(bool exist))callback
-
New:
setJavascriptCloseWindowListener:(void(^)(void))callback
-
New:
setDebugMode:(bool) debug
-
New:
customJavascriptDialogLabelTitles:(NSDictionary*) dic
-
New feature: Support namespace
-
New feature: Can add multiple API object
-
Changed: Object-c API signature changed
-
Changed:
callHandler
can be called at any time.
In Javascript
- New:
hasNativeMethod(handlerName,[type])
- New:
disableJavascriptDialogBlock(disable)
- New:
registerAsyn(methodName|namespace,function|asyApiObject)
- Changed:
register(methodName|namespace,function|synApiObject)
- New feature: Support namespace
Why Only Support WKWebView?
Advantages of WKWebView
It is well known that WKWebView loads web pages faster and more efficiently than UIWebView, and also doesn't have as much memory overhead for you.
Under the current timeline, most iOS apps only support iOS 9.0+.
UIWebView Cross-Domain Access Vulnerability
The reason for the iOS platform cross-domain access vulnerability is due to UIWebView turning on the WebKitAllowUniversalAccessFromFileURLs and WebKitAllowFileAccessFromFileURLs options.
WKWebView default allowFileAccessFromFileURLs and allowUniversalAccessFromFileURLs option is false.