From 19f59c9ff492be696406773d575e90060972286d Mon Sep 17 00:00:00 2001 From: Sid Vishnoi <8426945+sidvishnoi@users.noreply.github.com> Date: Tue, 1 Oct 2024 15:57:51 +0530 Subject: [PATCH] fix(content): ignore non-monetization links when `` removed (#635) --- src/content/services/monetizationLinkManager.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/content/services/monetizationLinkManager.ts b/src/content/services/monetizationLinkManager.ts index 682f0a5f..2a8ebcd4 100644 --- a/src/content/services/monetizationLinkManager.ts +++ b/src/content/services/monetizationLinkManager.ts @@ -363,8 +363,9 @@ export class MonetizationLinkManager extends EventEmitter { for (const record of records) { if (record.type === 'childList') { - record.removedNodes.forEach(async (node) => { + record.removedNodes.forEach((node) => { if (!(node instanceof HTMLLinkElement)) return; + if (!this.monetizationLinks.has(node)) return; const payloadEntry = this.onRemovedLink(node); stopMonetizationPayload.push(payloadEntry); });