spot: kill alive signal on first response
This commit is contained in:
parent
c409840e9f
commit
25b7efe629
1 changed files with 5 additions and 2 deletions
|
|
@ -340,11 +340,14 @@ export default defineContentScript({
|
|||
});
|
||||
}
|
||||
|
||||
setInterval(() => {
|
||||
void browser.runtime.sendMessage({ type: messages.content.from.contentReady });
|
||||
const pingInt = setInterval(() => {
|
||||
try {
|
||||
void browser.runtime.sendMessage({ type: messages.content.from.contentReady });
|
||||
} catch (_) {}
|
||||
}, 250);
|
||||
// @ts-ignore false positive
|
||||
browser.runtime.onMessage.addListener((message: any, resp) => {
|
||||
clearInterval(pingInt);
|
||||
if (message.type === messages.content.to.mount) {
|
||||
if (recState === "count") return;
|
||||
recState = "count";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue