From 58f868b906c10e61fb90e0005938a23dacb5db05 Mon Sep 17 00:00:00 2001 From: Michael Gangolf Date: Sat, 7 Oct 2023 16:32:47 +0200 Subject: [PATCH] docs: webview html example (#13932) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: webview html example * Update WebView.yml --------- Co-authored-by: Hans Knöchel --- apidoc/Titanium/UI/WebView.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apidoc/Titanium/UI/WebView.yml b/apidoc/Titanium/UI/WebView.yml index 90c9968e094..0c715e3f03e 100644 --- a/apidoc/Titanium/UI/WebView.yml +++ b/apidoc/Titanium/UI/WebView.yml @@ -868,6 +868,15 @@ properties: The web view's content can also be set using the [data](Titanium.UI.WebView.data) or [url](Titanium.UI.WebView.url) properties. + If you want to get the HTML content of a remote URL you can grab it with this `evalJS` call: + ``` js + webview.addEventListener('load', function() { + webview.evalJS('document.documentElement.outerHTML.toString()', function(data) { + console.log(data); + }); + }); + ``` + See also: [data](Titanium.UI.WebView.data) and [url](Titanium.UI.WebView.url). type: String