Search code examples
androidsecurityandroid-webview

How can I prevent an Android WebView from manipulating a web page?


As shown here it is possible to: 1. Create an Android WebView with setJavaScriptEnabled=true 2. Load a URL 3. Override onPageFinished and change the Web page displayed to the user

Now, is it possible for the Web page owner to implement anything server-side which prevents this from happening? The risk is that a malicious app could spoof the user by amending the Web page for nefarious means...

Many thanks!


Solution

  • It is not really possible to prevent the web response being modified. You can only think of making it difficult for the spoofer to edit it.