diff --git a/library/src/main/java/com/github/lzyzsd/jsbridge/BridgeWebView.java b/library/src/main/java/com/github/lzyzsd/jsbridge/BridgeWebView.java index d4fcf53..0531346 100644 --- a/library/src/main/java/com/github/lzyzsd/jsbridge/BridgeWebView.java +++ b/library/src/main/java/com/github/lzyzsd/jsbridge/BridgeWebView.java @@ -215,6 +215,17 @@ public void registerHandler(String handlerName, BridgeHandler handler) { messageHandlers.put(handlerName, handler); } } + + /** + * unregister handler + * + * @param handlerName + */ + public void unregisterHandler(String handlerName) { + if (handlerName != null) { + messageHandlers.remove(handlerName); + } + } /** * call javascript registered handler