summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/core/web_contents_adapter.cpp10
-rw-r--r--src/core/web_contents_adapter.h4
-rw-r--r--src/webengine/api/qquickwebengineview.cpp4
-rw-r--r--src/webenginewidgets/api/qwebenginepage.cpp8
-rw-r--r--src/webenginewidgets/api/qwebenginepage.h4
5 files changed, 16 insertions, 14 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 3ea5e416..ffb31ce8 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -610,21 +610,23 @@ void WebContentsAdapter::enableInspector(bool enable)
ContentBrowserClientQt::Get()->enableInspector(enable);
}
-void WebContentsAdapter::runJavaScript(const QString &javaScript, const QString &xPath)
+void WebContentsAdapter::runJavaScript(const QString &javaScript)
{
Q_D(WebContentsAdapter);
content::RenderViewHost *rvh = d->webContents->GetRenderViewHost();
Q_ASSERT(rvh);
- rvh->ExecuteJavascriptInWebFrame(toString16(xPath), toString16(javaScript));
+ base::string16 mainFrameXPath;
+ rvh->ExecuteJavascriptInWebFrame(mainFrameXPath, toString16(javaScript));
}
-quint64 WebContentsAdapter::runJavaScriptCallbackResult(const QString &javaScript, const QString &xPath)
+quint64 WebContentsAdapter::runJavaScriptCallbackResult(const QString &javaScript)
{
Q_D(WebContentsAdapter);
content::RenderViewHost *rvh = d->webContents->GetRenderViewHost();
Q_ASSERT(rvh);
content::RenderViewHost::JavascriptResultCallback callback = base::Bind(&callbackOnEvaluateJS, d->adapterClient, ++d->lastRequestId);
- rvh->ExecuteJavascriptInWebFrameCallbackResult(toString16(xPath), toString16(javaScript), callback);
+ base::string16 mainFrameXPath;
+ rvh->ExecuteJavascriptInWebFrameCallbackResult(mainFrameXPath, toString16(javaScript), callback);
return d->lastRequestId;
}
diff --git a/src/core/web_contents_adapter.h b/src/core/web_contents_adapter.h
index 371be5d9..d327de04 100644
--- a/src/core/web_contents_adapter.h
+++ b/src/core/web_contents_adapter.h
@@ -97,8 +97,8 @@ public:
qreal currentZoomFactor() const;
void enableInspector(bool);
void filesSelectedInChooser(const QStringList &fileList, WebContentsAdapterClient::FileChooserMode);
- void runJavaScript(const QString &javaScript, const QString &xPath);
- quint64 runJavaScriptCallbackResult(const QString &javaScript, const QString &xPath);
+ void runJavaScript(const QString &javaScript);
+ quint64 runJavaScriptCallbackResult(const QString &javaScript);
quint64 fetchDocumentMarkup();
quint64 fetchDocumentInnerText();
quint64 findText(const QString &subString, bool caseSensitively, bool findBackward);
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index 0a5150c3..a11a57cd 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -550,10 +550,10 @@ QQmlComponent *QQuickWebEngineViewExperimental::extraContextMenuEntriesComponent
void QQuickWebEngineViewExperimental::runJavaScript(const QString &script, const QJSValue &callback)
{
if (!callback.isUndefined()) {
- quint64 requestId = d_ptr->adapter->runJavaScriptCallbackResult(script, /*xPath=*/QString());
+ quint64 requestId = d_ptr->adapter->runJavaScriptCallbackResult(script);
d_ptr->m_callbacks.insert(requestId, callback);
} else
- d_ptr->adapter->runJavaScript(script, /*xPath=*/QString());
+ d_ptr->adapter->runJavaScript(script);
}
QQuickWebEngineHistory *QQuickWebEngineViewExperimental::navigationHistory() const
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp
index 2abfa4de..4bd97c07 100644
--- a/src/webenginewidgets/api/qwebenginepage.cpp
+++ b/src/webenginewidgets/api/qwebenginepage.cpp
@@ -803,16 +803,16 @@ void QWebEnginePage::setZoomFactor(qreal factor)
d->adapter->setZoomFactor(factor);
}
-void QWebEnginePage::runJavaScript(const QString &scriptSource, const QString &xPath)
+void QWebEnginePage::runJavaScript(const QString &scriptSource)
{
Q_D(QWebEnginePage);
- d->adapter->runJavaScript(scriptSource, xPath);
+ d->adapter->runJavaScript(scriptSource);
}
-void QWebEnginePage::runJavaScript(const QString& scriptSource, const QWebEngineCallback<const QVariant &> &resultCallback, const QString &xPath)
+void QWebEnginePage::runJavaScript(const QString& scriptSource, const QWebEngineCallback<const QVariant &> &resultCallback)
{
Q_D(QWebEnginePage);
- quint64 requestId = d->adapter->runJavaScriptCallbackResult(scriptSource, xPath);
+ quint64 requestId = d->adapter->runJavaScriptCallbackResult(scriptSource);
d->m_callbacks.registerCallback(requestId, resultCallback.d);
}
diff --git a/src/webenginewidgets/api/qwebenginepage.h b/src/webenginewidgets/api/qwebenginepage.h
index 4c24db61..be5e4c52 100644
--- a/src/webenginewidgets/api/qwebenginepage.h
+++ b/src/webenginewidgets/api/qwebenginepage.h
@@ -175,8 +175,8 @@ public:
qreal zoomFactor() const;
void setZoomFactor(qreal factor);
- void runJavaScript(const QString& scriptSource, const QString &xPath = QString());
- void runJavaScript(const QString& scriptSource, const QWebEngineCallback<const QVariant &> &resultCallback, const QString &xPath = QString());
+ void runJavaScript(const QString& scriptSource);
+ void runJavaScript(const QString& scriptSource, const QWebEngineCallback<const QVariant &> &resultCallback);
Q_SIGNALS:
void loadStarted();