Skip to content

Commit 274ef59

Browse files
committed
🐛 修复GM_openInTab active参数始终为true的问题
1 parent 7a7e221 commit 274ef59

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "scriptcat",
3-
"version": "0.14.1",
3+
"version": "0.14.2",
44
"description": "脚本猫,一个可以执行用户脚本的浏览器扩展,万物皆可脚本化,让你的浏览器可以做更多的事情!",
55
"author": "CodFrm",
66
"license": "GPLv3",

src/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 2,
33
"name": "ScriptCat",
4-
"version": "0.14.1",
4+
"version": "0.14.2",
55
"author": "CodFrm",
66
"description": "脚本猫,一个用户脚本管理器,支持后台脚本、定时脚本、页面脚本,可编写脚本每天帮你自动处理事务.",
77
"options_ui": {

src/runtime/background/gm_api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ export default class GMApi {
486486
channel.disChannel();
487487
}
488488
} else {
489-
chrome.tabs.create({ url, active: options.active || true }, (tab) => {
489+
chrome.tabs.create({ url, active: options.active }, (tab) => {
490490
Cache.getInstance().set(`GM_openInTab:${tab.id}`, channel);
491491
channel.send({ event: "oncreate", tabId: tab.id });
492492
});

src/runtime/content/gm_api.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,9 @@ export default class GMApi {
564564
} else {
565565
option = <GMTypes.OpenTabOptions>options;
566566
}
567+
if (option.active === undefined) {
568+
option.active = true;
569+
}
567570
let tabid: any;
568571

569572
const ret: GMTypes.Tab = {

0 commit comments

Comments
 (0)