mirror of
https://github.com/mdn/webextensions-examples.git
synced 2026-04-26 19:14:30 +02:00
Rewrite examples to use browser.* and promises (#138)
This commit is contained in:
@@ -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 = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user