From 1043c0507981c35047832c3d8e942c3840484b9a Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 27 Jun 2016 17:41:39 +0200 Subject: Doc: Move details about script injection in overview to separate section Change-Id: I51562b2dff1ffe4359c6db4a802c406c3706de84 Reviewed-by: Leena Miettinen --- src/webengine/doc/src/qtwebengine-overview.qdoc | 31 ++++++++++++++----------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/webengine/doc/src/qtwebengine-overview.qdoc b/src/webengine/doc/src/qtwebengine-overview.qdoc index 5cf3a0eb0..3780e6288 100644 --- a/src/webengine/doc/src/qtwebengine-overview.qdoc +++ b/src/webengine/doc/src/qtwebengine-overview.qdoc @@ -98,19 +98,6 @@ execute JavaScript. This mitigates security issues and isolates crashes caused by specific content. - The document object model (DOM) of a page is constructed when the document is ready, typically - when the page is completely loaded. Therefore, executing scripts as soon as a document is - created is not suitable for DOM operations, where one has to wait until the DOM is ready. - - In addition, an injected script shares the same \e world as the other scripts executed on the - page, which might lead to conflicts. To avoid this, the QWebEngineScript class and the - WebEngineScript QML type provide implementations of the Chromium API for - \e{Content Script Extensions}. They specify the - script to run, the injection point, and the world where the script is run. This enables - accessing the DOM to manipulate it within a world. - - \note Chromium extensions, such as \c @include, \c @match, and \c @exclude, are not supported. - \section1 Embedding Web Content into Widget Based Applications Use the QWebEngineView class to display web pages in the simplest way. Because it is a widget, @@ -178,6 +165,24 @@ \skipto import \printuntil /^\}/ + \section1 Script Injection + + Qt WebEngine does not allow direct access to the document object model (DOM) of a page. + However, the DOM can be inspected and adapted by injecting scripts. + + The DOM of a page is constructed when the document is ready, typically + when the page is completely loaded. Therefore, executing scripts as soon as a document is + created is not suitable for DOM operations, where one has to wait until the DOM is ready. + + In addition, an injected script shares the same \e world as the other scripts executed on the + page, which might lead to conflicts. To avoid this, the QWebEngineScript class and the + WebEngineScript QML type provide implementations of the Chromium API for + \e{Content Script Extensions}. They specify the + script to run, the injection point, and the world where the script is run. This enables + accessing the DOM to manipulate it within a world. + + \note Chromium extensions, such as \c @include, \c @match, and \c @exclude, are not supported. + \section1 Managing Certificates Qt WebEngine uses its own network stack, and therefore QSslConfiguration is not used to -- cgit v1.2.3