GM_registerMenuCommand 二级菜单 & 分隔线#831
Merged
CodFrm merged 5 commits intoscriptscat:mainfrom Oct 12, 2025
Merged
Conversation
Closed
Member
|
regMenuCounter 是递增实现的,如果注册顺序一样的话,也还是会合并(和我最开始的版本一样),这是符合期望的吗? 如果同名的话感觉也符合 |
Collaborator
Author
regMenuCounter 是为了令 mainframe subframes 执行相同操作的话,视为同一个项目 每次注册都会加一,但通常不会用到 (而且是内部用代码) |
CodFrm
added a commit
to scriptscat/scriptcat.org
that referenced
this pull request
Oct 12, 2025
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.
概述
close #781
使用 option nested = false 为原本的API增加二级菜单功能
GM_registerMenuCommand("")或GM_registerMenuCommand("", undefined, {nested: false})可新增不合并显示的分隔线使用 option individual = true 时同一frame的菜单选项不会合并起来
nested 不影响原有功能。兼容TM
注:不同frame还是会合并,否则frame 和 frame 之间的单独项目(例如分隔线)的次序合并会混乱起来,用户不能正常使用
如frame 和 frame 之间不希望合并,开发人员应使用不同的菜单项目名称
DEMO
( 有没有 iframe 也一样的显示 )
截图