From bf6c96a3b165197ff3bb2c4ffa6cbcb4f078d83b Mon Sep 17 00:00:00 2001 From: Jack Case Date: Sun, 26 Oct 2025 14:41:03 -0400 Subject: [PATCH] report successful login and update pageaction icon on report --- manifest.json | 2 +- pages/action_popup.html | 2 +- scripts/report-slop.js | 9 ++++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/manifest.json b/manifest.json index 794d098..509452b 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "Slop Farmer", - "version": "0.2", + "version": "0.3", "author": "Jack Case", "description": "Crowd-source AI slop pages and domains", diff --git a/pages/action_popup.html b/pages/action_popup.html index a4de024..f54a76f 100644 --- a/pages/action_popup.html +++ b/pages/action_popup.html @@ -8,7 +8,6 @@ Slop Farmer -

Hello, world!

@@ -16,4 +15,5 @@
+

You're logged in.

\ No newline at end of file diff --git a/scripts/report-slop.js b/scripts/report-slop.js index d577976..666131e 100644 --- a/scripts/report-slop.js +++ b/scripts/report-slop.js @@ -3,6 +3,10 @@ let access_token const login_form = document.getElementById("login-form") if(login_form) { + const login_status = document.getElementById("login-status") + if (localStorage.getItem("accessToken")) { + login_status.setAttribute("style", "visibility: visible;") + } login_form.addEventListener("submit", (event) => {event.preventDefault(); submit_login_form()}) } @@ -148,7 +152,8 @@ async function on_button_clicked_handler(tab) { const domain = tab_url.hostname const path = tab_url.pathname - insert_slop(domain, path) + await insert_slop(domain, path) + update_page_action_icon({frameId: 0, tabId: tab.id, url: tab.url}) } async function update_page_action_icon(details) { @@ -227,6 +232,8 @@ async function submit_login_form() { const body = await response.json() const token = body.access_token localStorage.setItem("accessToken", token) + const status_el = document.getElementById("login-status") + status_el.setAttribute("style", "visibility: visible;") } }