now we're properly sending our request after we've checked locally
This commit is contained in:
@@ -116,7 +116,7 @@ async function check_remote_slop(urls) {
|
|||||||
const request = new Request(check_url, {method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({slop_urls: urls})})
|
const request = new Request(check_url, {method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({slop_urls: urls})})
|
||||||
const response = await fetch(request)
|
const response = await fetch(request)
|
||||||
let domain_objects = await response.json()
|
let domain_objects = await response.json()
|
||||||
domain_objects.foreach((domain) => {insert_slop(domain, "/")})
|
domain_objects.forEach((domain) => {insert_slop(domain.domain_name, "/")})
|
||||||
return domain_objects
|
return domain_objects
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,6 +173,8 @@ async function message_listener(message, sender) {
|
|||||||
}))
|
}))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
await Promise.all(check_promises)
|
||||||
|
|
||||||
remote_slop = await check_remote_slop(not_found_local)
|
remote_slop = await check_remote_slop(not_found_local)
|
||||||
remote_slop.forEach((result) => {
|
remote_slop.forEach((result) => {
|
||||||
browser.tabs.sendMessage(tabid, { type: "check_result", url: result.url, result: result })
|
browser.tabs.sendMessage(tabid, { type: "check_result", url: result.url, result: result })
|
||||||
|
|||||||
Reference in New Issue
Block a user