add voice activity detection
This commit is contained in:
@@ -170,7 +170,8 @@ async function stopCapture() {
|
||||
|
||||
if (optionTabId) {
|
||||
res = await sendMessageToTab(currentTabId, {
|
||||
type: "STOP"
|
||||
type: "STOP",
|
||||
data: { currentTabId: currentTabId },
|
||||
});
|
||||
await removeChromeTab(optionTabId);
|
||||
}
|
||||
@@ -188,3 +189,15 @@ chrome.runtime.onMessage.addListener((message) => {
|
||||
stopCapture();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Listens for if the tab is reloaded.
|
||||
* @param {Object} message - The message received from the runtime.
|
||||
*/
|
||||
chrome.tabs.onUpdated.addListener(async (tabId, changeInfo, tab) => {
|
||||
if (changeInfo.status === 'complete') {
|
||||
await executeScriptInTab(tabId, "content.js");
|
||||
await delayExecution(500);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user