aboutsummaryrefslogtreecommitdiffhomepage
path: root/addon/background.js
blob: 24771aac026a12c237dbcbdb50697d1ce7ade5c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
console.log('background')

browser.contextMenus.create(
  {
    id: 'map-inline',
    title: 'MapInline',
    contexts: ['page', 'selection'],
  },
  () => void browser.runtime.lastError,
)

browser.contextMenus.onClicked.addListener((info, tab) => {
  if (info.menuItemId !== 'map-inline') return

  browser.tabs.sendMessage(tab.id, 'map-inline')
})