There's no built-in equivalent, but you can reproduce this behavior by setting up a message handler in a user script that triggers an event in the DOM that you handle in the HTML document. For each of these steps, the code to be executed is passed along. For a simple example:
oxide-test.qml
import QtQuick 2.0
import Ubuntu.Components 0.1
import com.canonical.Oxide 1.0
Rectangle {
width: units.gu(50)
height: units.gu(75)
// Both the UserScript and the call to sendMessage need to share the same
// context, which should be in the form of a URL. It doesn't seem to matter
// what it is, though.
property string usContext: "messaging://"
WebView {
id: webview
anchors {
top: parent.top
left: parent.left
right: parent.right
bottom: button.top
}
context: webcontext
url: Qt.resolvedUrl("oxide-test.html")
function executeJavascript(code) {
var req = rootFrame.sendMessage(usContext, "EXECUTE", {code: code});
}
}
WebContext {
id: webcontext
userScripts: [
UserScript {
context: usContext
url: Qt.resolvedUrl("oxide-user.js")
}
]
}
Button {
id: button
anchors {
bottom: parent.bottom
left: parent.left
right: parent.right
}
text: "Press Me"
onClicked: webview.executeJavascript("exampleFunc('Hello');")
}
}
oxide-user.js
oxide.addMessageHandler("EXECUTE", function (msg) {
var event = new CustomEvent("ExecuteJavascript", {detail: msg.args.code});
document.dispatchEvent(event);
});
oxide-test.html
<html>
<head>
<script>
document.addEventListener("ExecuteJavascript", function (event) { eval(event.detail); });
function exampleFunc(message) {
document.body.innerHTML += "<p>" + message + "</p>";
}
</script>
</head>
<body>
</body>
</html>
(Note that if all you're trying to do is manipulate the DOM, you can do so from within the user script.)
This code doesn't allow you to get the result of the execution. You may be able to pass a callback in, but I suspect this won't actually work. Instead, you'll need to set up a parallel messaging chain to get the result back to the QML context.