Fuck You, Chrome API documentation!!11

This commit is contained in:
Alexey Skobkin 2015-01-07 08:19:02 +04:00
parent 180d58b464
commit 93a24c57d4
1 changed files with 22 additions and 1 deletions

View File

@ -49,6 +49,9 @@ chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
sendResponse(true); sendResponse(true);
console.log('Showed pageAction for tab #%s', sender.tab.id); console.log('Showed pageAction for tab #%s', sender.tab.id);
// Fuck You, Chrome API documentation!!11
return true;
break; break;
case 'showNotification': case 'showNotification':
@ -67,6 +70,8 @@ chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
} }
); );
// Fuck You, Chrome API documentation!!11
return true;
break; break;
case 'listenNotificationClicks': case 'listenNotificationClicks':
@ -88,6 +93,9 @@ chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
}); });
sendResponse(true); sendResponse(true);
// Fuck You, Chrome API documentation!!11
return true;
break; break;
/** /**
@ -103,6 +111,9 @@ chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
console.info('JS file executed: "%s"', message.file); console.info('JS file executed: "%s"', message.file);
}); });
// Fuck You, Chrome API documentation!!11
return true;
break; break;
// Inject several files // Inject several files
@ -112,9 +123,11 @@ chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
if (message.files.length) { if (message.files.length) {
injectJS(sender.tab.id ? sender.tab.id : null, message.files, function() { injectJS(sender.tab.id ? sender.tab.id : null, message.files, function() {
// @fixme does not sending response now! // @fixme does not sending response now!
console.info('All scripts executed');
sendResponse(true); sendResponse(true);
console.info('All scripts executed'); return true;
}); });
} else { } else {
/* /*
@ -125,6 +138,9 @@ chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
console.warn('No scripts executed (empty script array)'); console.warn('No scripts executed (empty script array)');
} }
// Fuck You, Chrome API documentation!!11
return true;
break; break;
/** /**
@ -139,6 +155,9 @@ chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
console.info('CSS file "%s" injected', message.file); console.info('CSS file "%s" injected', message.file);
}); });
// Fuck You, Chrome API documentation!!11
return true;
break; break;
case 'injectCSSCode': case 'injectCSSCode':
@ -152,6 +171,8 @@ chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
}); });
} }
// Fuck You, Chrome API documentation!!11
return true;
break; break;
} }
} }