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
2bfd7031d09f2a48c20a11b1cbfb2949bea055b8
parent
b63d1d352c85a7729b01d01d189157dd75d5e771
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2025-04-24 07:02
chrome: adapt favicon for manifest v3

see https://developer.chrome.com/docs/extensions/how-to/ui/favicons

Diffstat

M stack.js 7 +++++--

1 files changed, 5 insertions, 2 deletions


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

@@ -11,11 +11,14 @@ var render = function(element, items) {
   11    11 			var icon = document.createElement('img');
   12    12 			icon.className = 'icon';
   13    13 
   -1    14 			var rootUrl = item.url.split('/').slice(0, 3).join('/');
   14    15 			if (chrome && typeof browser === 'undefined') {
   15    -1 				icon.src = 'chrome://favicon/' + item.url;
   -1    16 				var url = new URL(chrome.runtime.getURL('/_favicon/'));
   -1    17 				url.searchParams.set('pageUrl', rootUrl);
   -1    18 				url.searchParams.set('size', '16');
   -1    19 				icon.src = url.toString();
   16    20 			} else {
   17    21 				// see https://bugzilla.mozilla.org/show_bug.cgi?id=1315616
   18    -1 				var rootUrl = item.url.split('/').slice(0, 3).join('/');
   19    22 				icon.src = rootUrl + '/favicon.ico';
   20    23 			}
   21    24