summaryrefslogtreecommitdiffstats
path: root/src/core/api/qwebenginescript.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/api/qwebenginescript.cpp')
-rw-r--r--src/core/api/qwebenginescript.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/core/api/qwebenginescript.cpp b/src/core/api/qwebenginescript.cpp
index 29b92a396..846b01196 100644
--- a/src/core/api/qwebenginescript.cpp
+++ b/src/core/api/qwebenginescript.cpp
@@ -131,12 +131,26 @@ void QWebEngineScript::setName(const QString &scriptName)
d->setName(scriptName);
}
-
+/*!
+ * Returns the remote source location of the user script (if any).
+ */
QUrl QWebEngineScript::sourceUrl() const
{
return d->sourceUrl();
}
+/*!
+ * Sets the remote source location of the user script to \a url.
+ *
+ * Unlike \l setSourceCode(), this function allows referring to user scripts that
+ * are not already loaded in memory, for instance, when stored on disk.
+ *
+ * Setting this value will change the \l sourceCode of the script.
+ *
+ * \note At present, only file-based sources are supported.
+ *
+ * \sa setSourceCode()
+ */
void QWebEngineScript::setSourceUrl(const QUrl &url)
{
if (url == sourceUrl())