admin管理员组文章数量:1391943
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?
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?
Share Improve this question asked Jun 6, 2014 at 20:09 seokaiseokai 235 bronze badges 2- Inject a content script, establish messaging between the two? – Xan Commented Jun 6, 2014 at 20:11
- Hi Xan, can you please provide a code example or tutorial? – seokai Commented Jun 8, 2014 at 9:35
1 Answer
Reset to default 11You can use executeScript for that too:
webview.executeScript(
{code: 'document.documentElement.innerHTML'},
function(results) {
// results[0] would have the webview's innerHTML.
});
本文标签: javascriptHow to access webview content in chrome appStack Overflow
版权声明:本文标题:javascript - How to access webview content in chrome app - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744697044a2620340.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论