bookmark-stack

web extension to save pages in a stack for reading them later  https://addons.mozilla.org/firefox/addon/bookmark-stack/
git clone https://git.ce9e.org/bookmark-stack.git

commit
d8a8816ac913cb25f7d26090f37168791e45a370
parent
2bfd7031d09f2a48c20a11b1cbfb2949bea055b8
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2025-04-24 07:03
chrome: resetting badge color is not supported

Diffstat

M shared.js 12 ++++++++----

1 files changed, 8 insertions, 4 deletions


diff --git a/shared.js b/shared.js

@@ -39,10 +39,14 @@ export var getBookmarks = async function() {
   39    39 
   40    40 export var updateCount = async function() {
   41    41 	var bookmarks = await getBookmarks();
   42    -1 	chrome.action.setBadgeText({text: '' + bookmarks.length});
   43    -1 	chrome.action.setBadgeBackgroundColor({
   44    -1 		color: bookmarks.length === 0 ? '#6b6b6b' : null
   45    -1 	});
   -1    42 	await chrome.action.setBadgeText({text: '' + bookmarks.length});
   -1    43 	try {
   -1    44 		// chrome does not support resetting the color, so we check for that first
   -1    45 		await chrome.action.setBadgeBackgroundColor({color: null});
   -1    46 		if (bookmarks.length === 0) {
   -1    47 			await chrome.action.setBadgeBackgroundColor({color: '#6b6b6b'});
   -1    48 		}
   -1    49 	} catch {}
   46    50 };
   47    51 
   48    52 export var popBookmark = async function(id) {