mgks / Android-SmartWebView

A simple use webview integrated w/ native features to help create most advanced hybrid applications.
https://mgks.dev/smart-webview
MIT License
561 stars 278 forks source link

How can I download every html webpage that I view within the WebView app? Offline view of previously loaded webpages? #245

Open koopdayetat opened 2 years ago

koopdayetat commented 2 years ago

I would like a feature where every webpage(not the whole entire website) that is visited automatically downloads the html of the single page that is loaded, so that it can be loaded offline. (Even webpages that are shown in Iframes)(Just text is fine)

And if possible, then you get to choose the amount of time it stays on the device before being deleted.

Can you create this or tell me what kind of code I would have to add?

koopdayetat commented 2 years ago

Would adding something like this help?

webview.loadUrl("javascript:HTMLOUT.processHTML(document.documentElement.outerHTML);");