Merge eth-go repository into go-ethereum
mist, etheruem have been moved to cmd/
This commit is contained in:
21
cmd/mist/assets/ext/qt_messaging_adapter.js
Normal file
21
cmd/mist/assets/ext/qt_messaging_adapter.js
Normal file
@@ -0,0 +1,21 @@
|
||||
window._messagingAdapter = function(data) {
|
||||
navigator.qt.postMessage(data);
|
||||
};
|
||||
|
||||
navigator.qt.onmessage = function(ev) {
|
||||
var data = JSON.parse(ev.data)
|
||||
|
||||
if(data._event !== undefined) {
|
||||
eth.trigger(data._event, data.data);
|
||||
} else {
|
||||
if(data._seed) {
|
||||
var cb = eth._callbacks[data._seed];
|
||||
if(cb) {
|
||||
cb.call(this, data.data)
|
||||
|
||||
// Remove the "trigger" callback
|
||||
delete eth._callbacks[ev._seed];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user