04/26 Enhanced functionalities
This commit is contained in:
@@ -182,6 +182,18 @@ chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => {
|
||||
// Store in local storage so the prompt survives service worker restarts
|
||||
// and is guaranteed to be present when the user next opens the popup.
|
||||
chrome.storage.local.set({ pending_save: msg.data });
|
||||
// Show a global "!" badge on the toolbar icon so the user knows to open
|
||||
// the popup even if they never do so otherwise.
|
||||
chrome.action.setBadgeText({ text: "!" });
|
||||
chrome.action.setBadgeBackgroundColor({ color: "#c0392b" });
|
||||
console.log("[PassKeeper] pending_save badge set for", msg.data?.siteName);
|
||||
sendResponse({ ok: true });
|
||||
return false;
|
||||
}
|
||||
|
||||
// Clear the pending-save badge once the popup signals it has handled the prompt.
|
||||
if (msg.type === "CLEAR_SAVE_BADGE") {
|
||||
chrome.action.setBadgeText({ text: "" });
|
||||
sendResponse({ ok: true });
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user