MCPcopy Create free account
hub / github.com/ChatGPTBox-dev/chatGPTBox / openUrl

Function openUrl

src/utils/open-url.mjs:3–11  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

1import Browser from 'webextension-polyfill'
2
3export 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}

Callers 4

index.mjsFile · 0.90
AppFunction · 0.90
index.mjsFile · 0.90
FeaturePagesFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected