Wish: WebView - get/set cookies & get document source

chip

New Member
Licensed User
Longtime User
Hi, Im new and looking over the controls, especially WebView.

I would like to be able to view and set the cookies, either for the current page, or for a given domain (whatever is easier). And to me, it doesnt matter if its returned as 1 string containing all cookies, or if its returned as an array.
Something like:
strCookies = WebView.GetCookies() 'get cookies of the current URL, returns as a delimited string
or
arrCookies = WebView.GetCookies("mydomain.com") ' get cookies for specific domain

and:
WebView.SetCookie("CookieName","CookieValue") ' adds a cookie to the current document location
or
WebView.SetCookie("mydomain.com","CookieName","CookieValue") ' adds a cookie for a specific domain

For example, I have an application that I would like to set a cookie ahead of time, before the page is loaded in the WebView control.


Next, I would like to be able to view the current location/documents HTML. For example: WebView.ViewHTML (so that I can run code based off of the contents of the page).

I see this was requested here: http://www.b4x.com/forum/basic4android-updates-questions/8312-getting-html-webview.html

While it might be sufficient in many cases, using a HTTP request/response is not possible for me. I need the actual source of the page after the user has done some navigating.



Thanks,
chip
 
Last edited:
Top