mirror of
https://github.com/mdn/webextensions-examples.git
synced 2026-04-17 06:48:37 +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
11 lines
339 B
JavaScript
11 lines
339 B
JavaScript
setInterval(function() {
|
|
var $game = document.querySelector('#game');
|
|
if($game.innerText !== 'ping'){
|
|
$game.innerText = 'ping';
|
|
} else{
|
|
browser.runtime.sendMessage({action: 'ping'}).then((response) => {
|
|
$game.innerText = response;
|
|
});
|
|
}
|
|
}, 1000);
|