diff --git a/src/webengine/doc/src/external-resources.qdoc b/src/webengine/doc/src/external-resources.qdoc index a75c7aaed88b72d30211be40fd1b689b3ef07887..6cced588ca1d94573ddec607f32452e15f66846e 100644 --- a/src/webengine/doc/src/external-resources.qdoc +++ b/src/webengine/doc/src/external-resources.qdoc @@ -136,3 +136,13 @@ \externalpage https://http2.akamai.com/demo \title Akamai HTTP/2 Demo */ + +/*! + \externalpage https://www.chromium.org/developers/design-documents/user-scripts + \title User Scripts +*/ + +/*! + \externalpage https://wiki.greasespot.net/Metadata_Block#.40name + \title Metadata Block +*/ diff --git a/src/webengine/doc/src/qtwebengine-overview.qdoc b/src/webengine/doc/src/qtwebengine-overview.qdoc index e180b22c01f65b270f4492453a22815d434de458..e9ca573b72ff6a0f53924a3148761b0033442e83 100644 --- a/src/webengine/doc/src/qtwebengine-overview.qdoc +++ b/src/webengine/doc/src/qtwebengine-overview.qdoc @@ -181,8 +181,29 @@ 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. - The following \l Greasemonkey attributes are supported since Qt 5.8: - \c @exclude, \c @include, \c @name, \c @match, and \c @run-at. + Since Qt 5.8, Qt WebEngine supports augmenting a script by using the + following \l{Metadata Block}{Greasemonkey-like attributes}: + + \list + \li \c {@exclude <regexp>} + \li \c {@include <regexp>} + \li \c {@match <regexp>} + \li \c {@name <free text>} + \li \c {@run-at [document-start|document-end|document-idle]} + \endlist + + The attributes determine if and when a \l {User Scripts}{user script} is + run. They must be placed immediately in the beginning of the script, inside + a \c ==UserScript== comment: + + \code + // ==UserScript== + // @include http://*.qt.io/* + // @exclude http://wiki.qt.io/* + // ==/UserScript== + + window.alert("Page is from qt.io, but not wiki.qt.io"); + \endcode \section1 Managing Certificates