spot: kill alive signal on first response

This commit is contained in:
nick-delirium 2025-05-23 12:10:05 +02:00
parent c409840e9f
commit 25b7efe629
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0

View file

@ -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";