Reputation: 23
I'm writing a chrome app which loads an external site via . Executing JavaScript within the loaded page does well with:
webview.executeScript();
But now I need to read the HTML-Content from that loaded external site in my main chrome app.
How can I achieve this?
Upvotes: 2
Views: 1641
Reputation: 444
You can use executeScript for that too:
webview.executeScript(
{code: 'document.documentElement.innerHTML'},
function(results) {
// results[0] would have the webview's innerHTML.
});
Upvotes: 11