Skip to content

Commit ddc6f85

Browse files
committed
feat: add an option to allow disable open list tab when store all tabs
1 parent 838431e commit ddc6f85

File tree

5 files changed

+19
-3
lines changed

5 files changed

+19
-3
lines changed

src/_locales/en/messages.json

+3
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@
116116
"opt_desc_openEnd": {
117117
"message": "When restore list open at the ending of tabs"
118118
},
119+
"opt_desc_openTabListNoTab": {
120+
"message": "Open the tab list when store all tabs"
121+
},
119122
"opt_label_popup": {
120123
"message": "Popup simple list"
121124
},

src/_locales/zh_CN/messages.json

+3
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@
116116
"opt_desc_openEnd": {
117117
"message": "恢复列表时标签页在末尾打开"
118118
},
119+
"opt_desc_openTabListNoTab": {
120+
"message": "当储存所有标签时打开标签列表"
121+
},
119122
"opt_label_popup": {
120123
"message": "弹出简单列表"
121124
},

src/common/options.js

+8
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,14 @@ export const optionsList = [
221221
default: true,
222222
new: '1.3.9',
223223
},
224+
{
225+
cate: cate.BEHAVIOUR,
226+
name: 'openTabListNoTab',
227+
desc: __('opt_desc_openTabListNoTab'),
228+
type: Boolean,
229+
default: true,
230+
new: '1.4.0',
231+
},
224232
]
225233

226234
if (DEBUG) {

src/common/tabs.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,15 @@ const storeSelectedTabs = async listIndex => {
106106

107107
const storeAllTabs = async listIndex => {
108108
const tabs = await getAllTabsInCurrentWindow()
109-
await openTabLists()
109+
const opts = await storage.getOptions()
110+
if (opts.openTabListNoTab) await openTabLists()
110111
return storeTabs(tabs, listIndex)
111112
}
112113

113114
const storeAllTabInAllWindows = async () => {
114115
const windows = await browser.windows.getAll()
115-
await openTabLists()
116+
const opts = await storage.getOptions()
117+
if (opts.openTabListNoTab) await openTabLists()
116118
for (const window of windows) {
117119
const tabs = await getAllInWindow(window.id)
118120
await storeTabs(tabs)

src/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 2,
33
"name": "__MSG_ext_name__",
4-
"version": "1.3.10",
4+
"version": "1.4.0",
55
"default_locale": "en",
66
"description": "__MSG_ext_desc__",
77
"author": "WangJie <[email protected]>",

0 commit comments

Comments
 (0)