fix: Fixed Badge Count Display for making all scripts inactive#986
Merged
CodFrm merged 4 commits intoscriptscat:mainfrom Nov 20, 2025
Merged
fix: Fixed Badge Count Display for making all scripts inactive#986CodFrm merged 4 commits intoscriptscat:mainfrom
CodFrm merged 4 commits intoscriptscat:mainfrom
Conversation
CodFrm
reviewed
Nov 20, 2025
Comment on lines
+323
to
+324
| if (tabId > 0) { | ||
| if (tabId !== lastActiveTabId) return; // 其他页面的指令,不理 |
Collaborator
Author
There was a problem hiding this comment.
>0 是有目前tab的id (不是 -1 , 0 之类的)
!== lastActiveTabId 是改变了tab
CodFrm
reviewed
Dec 8, 2025
| this.genScriptMenu(); | ||
| } | ||
| // 更新Badge显示。 | ||
| this.updateBadgeIcon(); |
Member
There was a problem hiding this comment.
badge浏览器支持按照tabId设置,不需要每次更新菜单时也更新badge
| if (!text && !badgeShownSet.has(tabId)) { | ||
| // 没有脚本不用显示 & 没有设置 | ||
| return; | ||
| } |
Member
There was a problem hiding this comment.
我将badgeShownSet这个逻辑修改了,修改为配置变更时,清理所有的tab,看起来 doBadgeAndMenuUpdate 也是为了做这件事
Collaborator
Author
There was a problem hiding this comment.
反正功能做到就行了
跟React无关的UI问题基本上都没有意见。因为问题出现和修正都较直观。React的改动会出现一堆效能问题
(其实可以的话,ScriptCat应该改成Vue核心。这样所有UI的设计就不会再头痛)
只是 popup badge 跟 menu 的显示问题,我认为跟 SPA 和上一页下一页那些,一拼考虑,重新设计一下比较好
也可以用 webNavigation API 而不要完全依赖 由脚本发出的 pageLoad. 特别是「清除」问题
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述 Descriptions
close #978
变更内容 Changes
截图 Screenshots