mirror of
https://github.com/mdn/webextensions-examples.git
synced 2026-04-17 14:59:12 +02:00
* convert chrome. to browser. Issue #165 * fix browser-polyfill * convert chrome.* to browser.* (#166) * convert chrome.* to browser.* * change chrome to browser * change the callback-style to promise-style * change the callback-style to promise-style
This commit is contained in:
@@ -12,4 +12,4 @@ var Background = {
|
||||
}
|
||||
};
|
||||
|
||||
chrome.runtime.onMessage.addListener(Background.receiveMessage);
|
||||
browser.runtime.onMessage.addListener(Background.receiveMessage);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
if($game.innerText !== 'ping'){
|
||||
$game.innerText = 'ping';
|
||||
} else{
|
||||
chrome.runtime.sendMessage({action: 'ping'},function(response) {
|
||||
browser.runtime.sendMessage({action: 'ping'}).then((response) => {
|
||||
$game.innerText = response;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user