Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.0 change list #25

Open
wendux opened this issue Feb 2, 2018 · 5 comments
Open

v3.0 change list #25

wendux opened this issue Feb 2, 2018 · 5 comments
Labels
Milestone

Comments

@wendux
Copy link
Owner

wendux commented Feb 2, 2018

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

  1. DeprecatedsetJavascriptInterface , use addJavascriptObject instead.

  2. DeprecatedsetJavascriptContextInitedListener ,callHandler can be called at any time.

  3. DeprecatedDUIWebView , UIWebView will not be supported ever.

  4. New: addJavascriptObject:(id) object namespace:(NSString *) namespace

  5. New: removeJavascriptObject:NSString * namespace

  6. New: disableJavascriptDialogBlock:(bool) disable

  7. New: hasJavascriptMethod:(NSString *) handlerName methodExistCallback:(void(^ )(bool exist))callback

  8. New: setJavascriptCloseWindowListener:(void(^)(void))callback

  9. New: setDebugMode:(bool) debug

  10. New: customJavascriptDialogLabelTitles:(NSDictionary*) dic

  11. New feature: Support namespace

  12. New feature: Can add multiple API object

  13. Changed: Object-c API signature changed

  14. Changed: callHandler can be called at any time.

In Javascript

  1. New: hasNativeMethod(handlerName,[type])
  2. New: disableJavascriptDialogBlock(disable)
  3. New: registerAsyn(methodName|namespace,function|asyApiObject)
  4. Changed: register(methodName|namespace,function|synApiObject)
  5. 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.

@wendux wendux added the New label Feb 2, 2018
@wendux wendux added this to the v3.0 milestone Feb 2, 2018
@alicksnake22
Copy link

alicksnake22 commented Feb 7, 2018

腾讯VasSonic不支持wkwebview,dsbridge不支持uiwebview。。。有点左右为难

@wendux
Copy link
Owner Author

wendux commented Feb 7, 2018

@alicksnake22 dsbridge3.0以后就不支持uiwebview了,如果仍需要使用uiwebview,请使用dsbridge2.0

@yikuo123
Copy link

yikuo123 commented Feb 7, 2018

WkWebView不能跟app共享Cookie

@wendux
Copy link
Owner Author

wendux commented Feb 7, 2018

@yikuo123 please refer to #28

@bobbox
Copy link

bobbox commented Jan 16, 2019

刚开始接触ios和h5混合,发现在h5页面登录跳转以后就调用不到了,请问怎么解决?谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants