|
|
|
@ -59,7 +59,7 @@ Rectangle { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Component.onCompleted: { |
|
|
|
|
webview.url = "/Users/jeffrey/test.html" |
|
|
|
|
webview.url = "http://etherian.io" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
signal messages(var messages, int id); |
|
|
|
@ -153,7 +153,9 @@ Rectangle { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function injectJs(js) { |
|
|
|
|
experimental.evaluateJavaScript(js) |
|
|
|
|
//webview.experimental.navigatorQtObjectEnabled = true; |
|
|
|
|
//webview.experimental.evaluateJavaScript(js) |
|
|
|
|
//webview.experimental.javascriptEnabled = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function sendMessage(data) { |
|
|
|
@ -164,7 +166,7 @@ Rectangle { |
|
|
|
|
experimental.preferences.javascriptEnabled: true |
|
|
|
|
experimental.preferences.navigatorQtObjectEnabled: true |
|
|
|
|
experimental.preferences.developerExtrasEnabled: true |
|
|
|
|
//experimental.userScripts: ["../ext/q.js", "../ext/eth.js/main.js", "../ext/eth.js/qt.js", "../ext/setup.js"] |
|
|
|
|
experimental.userScripts: ["../ext/q.js", "../ext/eth.js/main.js", "../ext/eth.js/qt.js", "../ext/setup.js"] |
|
|
|
|
experimental.onMessageReceived: { |
|
|
|
|
console.log("[onMessageReceived]: ", message.data) |
|
|
|
|
// TODO move to messaging.js |
|
|
|
@ -344,11 +346,15 @@ Rectangle { |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case "newIdentity": |
|
|
|
|
postData(data._id, shh.newIdentity()) |
|
|
|
|
var id = shh.newIdentity() |
|
|
|
|
console.log("newIdentity", id) |
|
|
|
|
postData(data._id, id) |
|
|
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
|
|
case "post": |
|
|
|
|
require(1); |
|
|
|
|
|
|
|
|
|
var params = data.args[0]; |
|
|
|
|
var fields = ["payload", "to", "from"]; |
|
|
|
|
for(var i = 0; i < fields.length; i++) { |
|
|
|
@ -359,8 +365,8 @@ Rectangle { |
|
|
|
|
params.priority = params.priority || 1000; |
|
|
|
|
params.ttl = params.ttl || 100; |
|
|
|
|
|
|
|
|
|
console.log(JSON.stringify(params)) |
|
|
|
|
shh.post(params.payload, params.to, params.from, params.topics, params.priority, params.ttl); |
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} catch(e) { |
|
|
|
|