mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-03-01 00:53:47 +00:00
Qt provider
This commit is contained in:
parent
74cab14b8d
commit
76b20be2ea
1 changed files with 15 additions and 0 deletions
15
qt.js
Normal file
15
qt.js
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
(function() {
|
||||
var QtProvider = function() {};
|
||||
QtProvider.prototype.send = function(payload) {
|
||||
navigator.qt.postData(JSON.stringify(payload));
|
||||
};
|
||||
Object.defineProperty(QtProvider.prototype, "onmessage", {
|
||||
set: function(handler) {
|
||||
navigator.qt.onmessage = handler;
|
||||
},
|
||||
});
|
||||
|
||||
if(typeof(web3) !== "undefined" && web3.providers !== undefined) {
|
||||
web3.QtProvider = QtProvider;
|
||||
}
|
||||
})();
|
||||
Loading…
Reference in a new issue