Skip to content

Commit 558fe20

Browse files
committed
tab-count-limit: do not display closed tabs
1 parent 8ff7ebc commit 558fe20

2 files changed

Lines changed: 5 additions & 15 deletions

File tree

webextensions/edge/tab-count-limit.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const TabCountLimit = {
4444
const excess = this.excessTabs(tabs);
4545
if (excess.length === 0) return;
4646
await this.closeTabs(excess);
47-
await this.warn(excess.length);
47+
await this.warn();
4848
},
4949

5050
async closeTabs(tabs) {
@@ -53,9 +53,9 @@ export const TabCountLimit = {
5353
));
5454
},
5555

56-
async warn(closedCount) {
56+
async warn() {
5757
await showDialog(
58-
`同時に開くことのできるタブの数は ${this.maxCount} 個までです。\n` +
59-
`超過して開かれたタブ ${closedCount} 個を閉じました。`);
60-
},
58+
`同時に開くことのできるタブの数は ${this.maxCount} 個までです。`
59+
);
60+
}
6161
}

webextensions/test/tab-count-limit.test.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -196,16 +196,6 @@ describe('check', () => {
196196
assert.match(calls.warned[0].message, /^W /);
197197
});
198198

199-
it('says how many tabs were closed and what the limit is', async () => {
200-
configure({ MaxCount: 3 });
201-
openTabs(5);
202-
203-
await TabCountLimit.check();
204-
205-
assert.match(calls.warned[0].message, /3 /);
206-
assert.match(calls.warned[0].message, /2 /);
207-
});
208-
209199
// The host answers only once the dialog is dismissed, so a second warning
210200
// behind the first would leave a dialog to dismiss for every tab opened.
211201
it('puts up one dialog at a time', async () => {

0 commit comments

Comments
 (0)