chore: better openUrl for independent conversation page

This commit is contained in:
josc146
2023-04-08 20:18:38 +08:00
parent d5bc2a8ed6
commit fe5081d9ab
3 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -18,7 +18,8 @@
"cookies",
"storage",
"contextMenus",
"unlimitedStorage"
"unlimitedStorage",
"tabs"
],
"background": {
"service_worker": "background.js"
+1
View File
@@ -15,6 +15,7 @@
"storage",
"contextMenus",
"unlimitedStorage",
"tabs",
"https://*.openai.com/",
"https://*.bing.com/"
],
+1 -1
View File
@@ -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 {