Is there any way to get access to DOM structure in Android’s WebView? I need it to check if some DOM object exists on page and then fire some events.
Thank you!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Not easily.
You can call
loadUrl("javascript:..."), where the...is a hunk of JavaScript code to be executed in the current Web page. If your “fire some events” are in the context of the Web page, perhaps this will suffice. If you need Java code to “fire some events”, you will also need to useaddJavaScriptInterface()to create a JavaScript->Java bridge object and have yourloadUrl("javascript:...")code invoke it, to get your data back out into Java.