简体   繁体   English

如何清除android中的所有Javascript函数

[英]How to clear all Javascript function in android

I'm just new in android webview. 我只是android webview中的新手。 In my application's webview, It's some Javascript functions for some specific native buttons which is interacted with Webview. 在我的应用程序的Webview中,它是一些Java功能,用于与Webview交互的某些特定本机按钮。 However, my problem is, there are so many function in a single webview. 但是,我的问题是,单个Web视图中有太多功能。 I have to check a lot a coditions to detect which funtion is using or not. 我必须检查很多代码以检测是否正在使用哪个功能。 Can anybody let me know how to reset or clear all Javascript function in webview android? 谁能让我知道如何重置或清除webview android中的所有Javascript函数?

by default javascript is disable in web view, you can enable it using this method void setJavaScriptEnabled (boolean flag) check out Doc for this method 默认情况下,JavaScript在Web视图中处于禁用状态,您可以使用此方法启用它void setJavaScriptEnabled (boolean flag) ,为此方法签出Doc

https://developer.android.com/reference/android/webkit/WebSettings.html#setJavaScriptEnabled(boolean) https://developer.android.com/reference/android/webkit/WebSettings.html#setJavaScriptEnabled(boolean)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM