Can a WebView access the content inside it, without having to modify the source HTML?
-
This feature would be useful for things like pre-populating forms. Something like what plugins for Firefox or Chrome do, when manipulating the DOM of the content they load.
-
Answer:
You can execute arbitrary JavaScript using WebView.loadUrl with JavaScript URLs, and thus access content, alter it, etc. For example, let's say you wanted to set the value of a user's name on the web page being shown by your WebView. You know that the name field has ID='username'. So you could do something like: myWebView.loadUrl("javascript:document.getElementById('username').value='Miguel'");
Michael Galpin at Quora Visit the source
Related Q & A:
- How do I display limited html content in a webview?Best solution by Stack Overflow
- Does anyone in Saudi Arabia know how can a Saudi girl travel alone without her father's permission?Best solution by Yahoo! Answers
- How can I put custom firmware on my PSP without a Pandora battery?Best solution by Yahoo! Answers
- What can a switchboard in access do and not do?
- Can a person be a graphic designer without a graphic design degree?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.