fix content script to check for messages from the background script properly
This commit is contained in:
@@ -27,8 +27,7 @@
|
|||||||
"content_scripts": [
|
"content_scripts": [
|
||||||
{
|
{
|
||||||
"matches": ["*://*.duckduckgo.com/*q=*"],
|
"matches": ["*://*.duckduckgo.com/*q=*"],
|
||||||
"js": ["scripts/content-script.js"],
|
"js": ["scripts/content-script.js"]
|
||||||
"type":"module"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,7 @@ function check_links(search_links: SearchLink[]) {
|
|||||||
async function backend_message_listener(message: any) {
|
async function backend_message_listener(message: any) {
|
||||||
// handle slop reports returned from the background script
|
// handle slop reports returned from the background script
|
||||||
switch(message.type) {
|
switch(message.type) {
|
||||||
case ("check-result"):
|
case ("check_result"):
|
||||||
if (message.domain) {
|
if (message.domain) {
|
||||||
const paths = page_links.getDomain(message.domain)
|
const paths = page_links.getDomain(message.domain)
|
||||||
paths.forEach((search_link: SearchLink) => {
|
paths.forEach((search_link: SearchLink) => {
|
||||||
@@ -120,7 +120,7 @@ function update_links() {
|
|||||||
return !(search_link.checked)
|
return !(search_link.checked)
|
||||||
})
|
})
|
||||||
|
|
||||||
check_links(link_iter)
|
check_links(link_iter.toArray())
|
||||||
}
|
}
|
||||||
|
|
||||||
function setup_result_observer() {
|
function setup_result_observer() {
|
||||||
|
|||||||
Reference in New Issue
Block a user