Skip to content

增强 chrome.tabs.create 兼容性#639

Merged
CodFrm merged 3 commits intoscriptscat:mainfrom
cyfung1031:fix_openTab
Aug 20, 2025
Merged

增强 chrome.tabs.create 兼容性#639
CodFrm merged 3 commits intoscriptscat:mainfrom
cyfung1031:fix_openTab

Conversation

@cyfung1031
Copy link
Copy Markdown
Collaborator

部份瀏覽器不支持 openerTabId ,windowId 等options

Comment thread src/pkg/utils/utils.ts
// 失敗的話,刪去 openerTabId 和 windowId ,再次嘗試打開
delete createProperties.openerTabId;
delete createProperties.windowId;
await chrome.tabs.create(createProperties);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以直接return chrome.tabs.create(createProperties);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

也可以。只是看你的设计没这个需要,所以只回传了 void

@CodFrm CodFrm merged commit 601b933 into scriptscat:main Aug 20, 2025
3 checks passed
CodFrm added a commit that referenced this pull request Aug 25, 2025
* 增强 chrome.tabs.create 兼容性

* 优化一些窗口的打开

* 第二次不用 try catch. 还是无法打开的话就报错,否则难以调试及用户回馈

---------

Co-authored-by: 王一之 <yz@ggnb.top>
CodFrm pushed a commit that referenced this pull request Aug 25, 2025
@cyfung1031 cyfung1031 deleted the fix_openTab branch October 4, 2025 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants