Issue
I pulled a website to a WebView
via HTTP GET. The problem is that the website isn't formatted for mobile. I found that if I edit the HTML, I can comment out the scripting that makes the left pane on the site.
Method:
Download page to string, search string for and replace first substring <link
with <!--
, write to file, and load into the WebView
.
That works great until it comes to a link. Clicking on it causes the WebView
to attempt to load file:///index.php/Whatever_the_page_was
.
What I want to do is capture that link request and change the file:///
part to www.wurmpedia.com
, and then run it through my parser to remove the script like the first, and repeat the process on any other link click that follows.
I could not find any other way to pull this off and this is what I made up. Any help would be appreciated, either through URL modification or with a more efficient method.
Solution
How about intercepting the link request using
WebView.shouldInterceptRequest
Answered By - ChinLoong
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.