blob: 6c007e542c32c1bd21a093468cc84e7aa13f5c5f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
browser.contextMenus.create(
{
id: 'map-inline-add',
title: 'Add Links and Maps by content',
contexts: ['page'],
},
)
browser.contextMenus.create(
{
id: 'map-inline-open',
title: 'Open in DumbyMap',
contexts: ['page', 'selection'],
},
() => void browser.runtime.lastError,
)
browser.contextMenus.onClicked.addListener((info, tab) => {
const id = info.menuItemId
if (!id.match(/^map-inline/)) return
browser.tabs.sendMessage(tab.id, id)
})
|