2014-03-11 14:48:26 +00:00
|
|
|
chrome.extension.onMessage.addListener(function(message, sender) {
|
|
|
|
if (message && message.type === 'showPageAction') {
|
|
|
|
var tab = sender.tab;
|
|
|
|
chrome.pageAction.show(tab.id);
|
|
|
|
}
|
2014-04-04 23:57:26 +00:00
|
|
|
|
|
|
|
if (message && message.type === 'showNotification') {
|
|
|
|
console.log(chrome.notifications.create(
|
|
|
|
message.notificationId, {
|
|
|
|
type: 'basic',
|
|
|
|
iconUrl: message.avatarUrl,
|
|
|
|
title: message.title,
|
|
|
|
message: message.text,
|
|
|
|
priority: 0
|
|
|
|
},
|
|
|
|
function() { /* Error checking goes here */}
|
|
|
|
));
|
|
|
|
}
|
2014-03-11 14:48:26 +00:00
|
|
|
});
|