Обнаружение звукового расширения хрома каждые 1 секунду
// detect if a tab is playing sound
async function getCurrentTab() {
let queryOptions = {
audible: true
};
// `tab` will either be a `tabs.Tab` instance or `undefined`.
let [tab] = await chrome.tabs.query(queryOptions);
return tab;
}
// check if a tab is playing sound every 1 second
async function update() {
const t1 = new Date();
const tabinfo = getCurrentTab()
await tabinfo;
tabinfo.then(value => {
if (value == undefined) {
console.log("Sound OFF ")
} else if (value.audible == true) {
console.log("Sound ON")
}
});
setTimeout(update, 1000);
}
update();
a_collection_of_cells