Rewrite examples to use browser.* and promises

This commit is contained in:
Will Bamberg
2016-11-10 16:17:58 -08:00
parent 1e8d35ff77
commit 328fdb32b7
33 changed files with 290 additions and 244 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
var html = document.querySelector('html');
var body = document.querySelector('body');
chrome.runtime.onMessage.addListener(updateBg);
browser.runtime.onMessage.addListener(updateBg);
function updateBg(request, sender, sendResponse) {
if(request.image) {
@@ -16,4 +16,4 @@ function updateBg(request, sender, sendResponse) {
body.style.backgroundImage = '';
body.style.backgroundColor = '';
}
}
}