wallet-core/extension/background/wallet.js
2015-12-05 16:32:31 +01:00

41 lines
974 B
JavaScript

'use strict';
//chrome.browserAction.setBadgeBackgroundColor({color: "#000"})
chrome.browserAction.setBadgeText({text: "42"})
chrome.browserAction.setTitle({title: "Taler: 42 EUR"})
function test_emscripten ()
{
var cur_time = TWRALLgetCurrentTime();
var fancy_time = TWRgetFancyTime(cur_time);
console.log('current time: '+ fancy_time);
}
test_emscripten();
DB.open(function () {
console.log ("DB: ready");
});
chrome.runtime.onMessage.addListener(
function (req, sender, onresponse) {
console.log("Message: " + req.type +
(sender.tab
? " from a content script: "+ sender.tab.url
: " from the extension"));
switch (req.type)
{
case "db-get-wallet":
DB.wallet_get (onresponse);
break;
case "db-list-transactions":
DB.transaction_list (onresponse);
break;
case "db-list-reserves":
DB.reserve_list (onresponse);
break;
}
});