diff --git a/manifest.json b/manifest.json index 36e1f1f..17ae283 100644 --- a/manifest.json +++ b/manifest.json @@ -8,7 +8,8 @@ "permissions": [ "activeTab", "storage", - "webNavigation" + "webNavigation", + "*://duckduckgo.com/*" ], "page_action": { @@ -31,7 +32,7 @@ "content_scripts": [ { - "matches": ["*://*.duckduckgo.com/*"], + "matches": ["*://duckduckgo.com/*"], "js": ["scripts/hide-slop.js"] } ] diff --git a/scripts/report-slop.js b/scripts/report-slop.js index ff47e72..b404c5f 100644 --- a/scripts/report-slop.js +++ b/scripts/report-slop.js @@ -1,4 +1,4 @@ -const API_URL = "" +const API_URL = "http://localhost:8000" function setup_storage_db() { /* create indexeddb object store to retain objects in the form of @@ -112,8 +112,8 @@ async function check_local_slop(url) { } async function check_remote_slop(urls) { - const check_url = new URL("check", API_URL) - const request = new Request(check_url, {method: "POST", body: JSON.stringify({slop_urls: urls})}) + const check_url = new URL("/check", API_URL) + const request = new Request(check_url, {method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({slop_urls: urls})}) const response = await fetch(request) let domain_objects = await response.json() domain_objects.foreach((domain) => {insert_slop(domain, "/")})