diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-09-24 12:03:59 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-09-24 13:03:43 +0200 |
commit | 52345f558f55e04ea68a8fa30d9862ca69131a18 (patch) | |
tree | 3bd9da3e6842af2d0b9c04b46693c66ab437fd2e /src/webenginewidgets/doc | |
parent | 16192598a84eaf9ac9a50b7cca6ac5e4c21bb5e8 (diff) | |
parent | d8fe250e542519012247952a034e78b0d492b730 (diff) |
Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
config.tests/glibc/glibc.cpp
src/3rdparty
src/core/configure.json
src/core/profile_io_data_qt.cpp
src/webengine/configure.json
src/webenginewidgets/api/qwebenginepage.cpp
tests/auto/widgets/qwebenginepage/BLACKLIST
Change-Id: I3e1781048c3cb09bfbf7427dfc5dd1fec11a2b97
Diffstat (limited to 'src/webenginewidgets/doc')
-rw-r--r-- | src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc | 19 |
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 699d7f181..7701b9b3d 100644 --- a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc +++ b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc @@ -767,10 +767,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, @@ -780,7 +785,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}. @@ -792,9 +797,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} */ /*! |