(url)
| 1 | import Browser from 'webextension-polyfill' |
| 2 | |
| 3 | export function openUrl(url) { |
| 4 | Browser.tabs.query({ url, currentWindow: true }).then((tabs) => { |
| 5 | if (tabs.length > 0) { |
| 6 | Browser.tabs.update(tabs[0].id, { active: true }) |
| 7 | } else { |
| 8 | Browser.tabs.create({ url }) |
| 9 | } |
| 10 | }) |
| 11 | } |
no outgoing calls
no test coverage detected