gPass/firefox_webextension/background.js

18 lines
411 B
JavaScript

browser.runtime.onMessage.addListener(
function(request) {
if (request.type == "notification")
{
options = {
type: "basic",
title : "gPass",
message : request.options.message,
iconUrl:browser.extension.getURL("icons/gpass_icon_64.png")
};
browser.notifications.create("gPass", options);
window.setTimeout(function() {browser.notifications.clear("gPass")}, 2000);
}
});