mirror of https://github.com/ethereum/go-ethereum
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
425 B
22 lines
425 B
10 years ago
|
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];
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|