summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets/doc
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-08-11 10:57:50 +0200
committerLiang Qi <liang.qi@qt.io>2019-08-11 10:57:50 +0200
commitd41f0bed7ddbdacb4f6444a84773a029e46988f3 (patch)
tree15a68979470278f0c13b2521cb614d5670288271 /src/webenginewidgets/doc
parent0caabd54a24ffa3a2d2de5cb6f1fce2af3588eb7 (diff)
parenta2c365cb1f22431845380159c29048da76c2b2a9 (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts: src/3rdparty Change-Id: I64b46801bbaac4e96e32fece30f24f1d6cfc97a4
Diffstat (limited to 'src/webenginewidgets/doc')
-rw-r--r--src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
index b68caed59..e5c0c0c3e 100644
--- a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
@@ -761,10 +761,15 @@
\fn void QWebEnginePage::runJavaScript(const QString &scriptSource, const QWebEngineCallback<const QVariant &> &resultCallback)
\since 5.7
- Runs the JavaScript code contained in \a scriptSource in the world specified by \a worldId.
- The world ID values are the same as provided by QWebEngineScript::ScriptWorldId, and between \c 0
- and \c 256. Using the \e runJavaScript() versions without the world ID is the same as running the
- script in the \c MainWorld.
+ Runs the JavaScript code contained in \a scriptSource without checking
+ whether the DOM of the page has been constructed. If you need more
+ control over how the script is run, consider using \l scripts() instead.
+
+ To avoid conflicts with other scripts executed on the page, the world in
+ which the script is run is specified by \a worldId. The world ID values are
+ the same as provided by QWebEngineScript::ScriptWorldId, and between \c 0
+ and \c 256. If you leave out the \c world ID, the script is run in the
+ \c MainWorld.
When the script has been executed, \a resultCallback is called with the result of the last
executed statement. \c resultCallback can be any of a function pointer, a functor or a lambda,
@@ -774,7 +779,7 @@
page.runJavaScript("document.title", [](const QVariant &v) { qDebug() << v.toString(); });
\endcode
- Only "plain data" can be returned from JavaScript as the result value.
+ Only plain data can be returned from JavaScript as the result value.
Supported data types include all of the JSON data types as well as, for
example, \c{Date} and \c{ArrayBuffer}. Unsupported data types include, for
example, \c{Function} and \c{Promise}.
@@ -786,9 +791,7 @@
during page destruction. When QWebEnginePage is deleted, the callback is triggered with an invalid
value and it is not safe to use the corresponding QWebEnginePage or QWebEngineView instance inside it.
- See scripts() for an alternative API to inject scripts.
-
- \sa QWebEngineScript::ScriptWorldId
+ \sa scripts(), QWebEngineScript::ScriptWorldId, {Script Injection}
*/
/*!