Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6642419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:55:41+00:00 2026-05-25T23:55:41+00:00

The following trick for getting page’s HTML content after javascript has been rendered works

  • 0

The following trick for getting page’s HTML content after javascript has been rendered works pretty well, when placed in the onNewPicture() of a WebView‘s PictureListener:

browser.loadUrl("javascript:window.HTMLOUT.showHTML('<head>'+document.getElementsByTagName('html')[0].innerHTML+'</head>');"); 

However, for some reason it works only the first time the page is loaded. That is, the application’s first such WebView.loadUrl() call gets a completely rendered version of the page.

Thereafter, if I reload/refresh the page (same exact URL), the output of HTMLOUT.showHTML() appears to be the original HTML+javascript before the page was rendered.

The strange thing is that visually, on the WebView itself, all content is there! (albeit after a significant delay… I can see the WebView’s hourglass spinning, perhaps it takes too long for Javascript to be re-processed?)

This seems to suggest either an initialization problem (in my code), a bug in WebView, or some caching principle that is well known to experienced web programmers but with which I am not familiar with yet.

But then it gets even more interesting: Subsequent calls to WebView.loadUrl() result in the aforementioned failure multiple (3-10) times until… the page is miraculously fully rendered again! (and then multiple failures again, and so on)

Which may suggest timing problem?

Any suggestion on how to debug or troubleshoot this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:55:42+00:00Added an answer on May 25, 2026 at 11:55 pm

    you have to inject the javascript after the page loads! Took me forever to figure it out

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the following command on WinXP and getting an error, but works
Following on from my previous question I have been working on getting my object
I've been following a tutorial but keep getting the following error AttributeError: Worm instance
I have the following 3 simple pages in a JSF app. index.html start.html confirmSuccess.thml
I had the following: <script type=text/javascript> var noteid = $('#noteid').val(); </script> <input type=hidden name=noteid
The following code only works when the copy constructor is available. When I add
I am getting the following error when trying to attach an object that is
I have a .jsp that contains an IFrame with a page that has some
I'm getting the following in the program output when I run my application. When
I'm getting the following error in xcode. error for object 0x4e18d00: pointer being freed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.