Bug 85496 - [Qt] Add QML/WK2 evaluateJavaScript experimental API
Summary: [Qt] Add QML/WK2 evaluateJavaScript experimental API
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kenneth Rohde Christiansen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-03 07:14 PDT by Kenneth Rohde Christiansen
Modified: 2012-05-08 07:13 PDT (History)
7 users (show)

See Also:


Attachments
Patch (6.40 KB, patch)
2012-05-03 07:17 PDT, Kenneth Rohde Christiansen
no flags Details | Formatted Diff | Diff
Patch (10.65 KB, patch)
2012-05-08 06:33 PDT, Kenneth Rohde Christiansen
hausmann: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kenneth Rohde Christiansen 2012-05-03 07:14:21 PDT
SSIA
Comment 1 Kenneth Rohde Christiansen 2012-05-03 07:17:15 PDT
Created attachment 140007 [details]
Patch
Comment 2 Kenneth Rohde Christiansen 2012-05-03 07:18:44 PDT
Can be tested like this. Alex said he would make some actual tests.

diff --git a/Tools/MiniBrowser/qt/qml/BrowserWindow.qml b/Tools/MiniBrowser/qt/qml/BrowserWindow.qml
index 9567e8b..16f5079 100644
--- a/Tools/MiniBrowser/qt/qml/BrowserWindow.qml
+++ b/Tools/MiniBrowser/qt/qml/BrowserWindow.qml
@@ -100,7 +100,7 @@ Rectangle {
                     onClicked: {
                         if (parent.enabled) {
                             console.log("MiniBrowser: Going backward in session history.")
-                            webView.goBack()
+                            webView.experimental.evaluateJavaScript("document.documentElement.innerHTML")
                         }
                     }
                 }
@@ -307,6 +307,7 @@ Rectangle {
             forceActiveFocus();
         }
 
+        experimental.onJavaScriptResult: { console.log(resultId + ': ' + result) }
         experimental.devicePixelRatio: 1.5
         experimental.preferredMinimumContentsWidth: 980
         experimental.itemSelector: ItemSelector { }
Comment 3 Kenneth Rohde Christiansen 2012-05-08 06:33:30 PDT
Created attachment 140701 [details]
Patch
Comment 4 Simon Hausmann 2012-05-08 06:47:43 PDT
Comment on attachment 140701 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=140701&action=review

> Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp:1291
> +    closure->method = 0;

This line isn't necessary given that method is a QByteArray that has a constructor.
Comment 5 Kenneth Rohde Christiansen 2012-05-08 07:13:56 PDT
Landed in 116420.