mirror of
https://github.com/wassname/chatGPTBox.git
synced 2026-07-12 03:15:50 +08:00
chore: better openUrl for independent conversation page
This commit is contained in:
+2
-1
@@ -18,7 +18,8 @@
|
||||
"cookies",
|
||||
"storage",
|
||||
"contextMenus",
|
||||
"unlimitedStorage"
|
||||
"unlimitedStorage",
|
||||
"tabs"
|
||||
],
|
||||
"background": {
|
||||
"service_worker": "background.js"
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
"storage",
|
||||
"contextMenus",
|
||||
"unlimitedStorage",
|
||||
"tabs",
|
||||
"https://*.openai.com/",
|
||||
"https://*.bing.com/"
|
||||
],
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Browser from 'webextension-polyfill'
|
||||
|
||||
export function openUrl(url) {
|
||||
Browser.tabs.query({ url }).then((tabs) => {
|
||||
Browser.tabs.query({ url, currentWindow: true }).then((tabs) => {
|
||||
if (tabs.length > 0) {
|
||||
Browser.tabs.update(tabs[0].id, { active: true })
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user