How to intercept POST data in an android webview

后端 未结 6 1111
故里飘歌
故里飘歌 2020-12-08 14:34

I have an android app that consists of a webview. It needs to allow users to fill in a form on a webpage and then change the data of the form after the user has clicked

6条回答
  •  甜味超标
    2020-12-08 15:01

    I wrote a library with a special WebViewClient that offers a modified shouldOverrideUrlLoading where you can have access to post data.

    https://github.com/KonstantinSchubert/request_data_webviewclient

    Unfortunately, my implementation works for XMLHttpRequest (AJAX) requests only. But somebody else drafted already how this would be done for form data: https://github.com/KeejOow/android-post-webview

    Between the two repositories, you should be able to find your answer :)

提交回复
热议问题