From 760e7c234a168804a116d3ecff7fb086c810ea37 Mon Sep 17 00:00:00 2001 From: Jack Case Date: Sat, 8 Nov 2025 19:09:15 +0000 Subject: [PATCH] fix content script to check for messages from the background script properly --- manifest.json | 3 +-- src/content-script.ts | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/manifest.json b/manifest.json index 530366c..6f169ca 100644 --- a/manifest.json +++ b/manifest.json @@ -27,8 +27,7 @@ "content_scripts": [ { "matches": ["*://*.duckduckgo.com/*q=*"], - "js": ["scripts/content-script.js"], - "type":"module" + "js": ["scripts/content-script.js"] } ] } \ No newline at end of file diff --git a/src/content-script.ts b/src/content-script.ts index cdfc309..1aa7b95 100644 --- a/src/content-script.ts +++ b/src/content-script.ts @@ -82,7 +82,7 @@ function check_links(search_links: SearchLink[]) { async function backend_message_listener(message: any) { // handle slop reports returned from the background script switch(message.type) { - case ("check-result"): + case ("check_result"): if (message.domain) { const paths = page_links.getDomain(message.domain) paths.forEach((search_link: SearchLink) => { @@ -120,7 +120,7 @@ function update_links() { return !(search_link.checked) }) - check_links(link_iter) + check_links(link_iter.toArray()) } function setup_result_observer() {