暂无描述

WKWebViewJavascriptBridge.h 1.0KB

1234567891011121314151617181920212223242526272829303132333435
  1. //
  2. // WKWebViewJavascriptBridge.h
  3. //
  4. // Created by @LokiMeyburg on 10/15/14.
  5. // Copyright (c) 2014 @LokiMeyburg. All rights reserved.
  6. //
  7. #if (__MAC_OS_X_VERSION_MAX_ALLOWED > __MAC_10_9 || __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_1)
  8. #define supportsWKWebView
  9. #endif
  10. #if defined supportsWKWebView
  11. #import <Foundation/Foundation.h>
  12. #import "WebViewJavascriptBridgeBase.h"
  13. #import <WebKit/WebKit.h>
  14. @interface WKWebViewJavascriptBridge : NSObject<WKNavigationDelegate, WebViewJavascriptBridgeBaseDelegate>
  15. + (instancetype)bridgeForWebView:(WKWebView*)webView;
  16. + (void)enableLogging;
  17. - (void)registerHandler:(NSString*)handlerName handler:(WVJBHandler)handler;
  18. - (void)removeHandler:(NSString*)handlerName;
  19. - (void)callHandler:(NSString*)handlerName;
  20. - (void)callHandler:(NSString*)handlerName data:(id)data;
  21. - (void)callHandler:(NSString*)handlerName data:(id)data responseCallback:(WVJBResponseCallback)responseCallback;
  22. - (void)reset;
  23. - (void)setWebViewDelegate:(id)webViewDelegate;
  24. - (void)disableJavscriptAlertBoxSafetyTimeout;
  25. @end
  26. #endif