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
f89bd0f2cf22ac96668df785a86761e85ea0df27
parent
2b39559e09864231d7ae3d91d7d8b83758f8d81b
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2025-04-24 07:05
fix: register context menues in onInstalled

Diffstat

M bg.js 28 +++++++++++++++-------------

1 files changed, 15 insertions, 13 deletions


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

@@ -2,24 +2,26 @@
    2     2 
    3     3 import { pushBookmark, updateCount } from './shared.js';
    4     4 
    5    -1 chrome.contextMenus.create({
    6    -1 	id: 'read-later',
    7    -1 	title: 'read later',
    8    -1 	contexts: ['page', 'selection', 'editable', 'image'],
    9    -1 });
   10    -1 
   11    -1 try {
   -1     5 chrome.runtime.onInstalled.addListener(() => {
   12     6 	chrome.contextMenus.create({
   13     7 		id: 'read-later',
   14     8 		title: 'read later',
   15    -1 		contexts: ['tab'],
   -1     9 		contexts: ['page', 'selection', 'editable', 'image'],
   16    10 	});
   17    -1 } catch {}
   18    11 
   19    -1 chrome.contextMenus.create({
   20    -1 	id: 'read-later-link',
   21    -1 	title: 'read link later',
   22    -1 	contexts: ['link'],
   -1    12 	try {
   -1    13 		chrome.contextMenus.create({
   -1    14 			id: 'read-later',
   -1    15 			title: 'read later',
   -1    16 			contexts: ['tab'],
   -1    17 		});
   -1    18 	} catch {}
   -1    19 
   -1    20 	chrome.contextMenus.create({
   -1    21 		id: 'read-later-link',
   -1    22 		title: 'read link later',
   -1    23 		contexts: ['link'],
   -1    24 	});
   23    25 });
   24    26 
   25    27 chrome.contextMenus.onClicked.addListener(async function(info, tab) {