实现 CAT_registerMenuInput 支持快捷输入交互#411
Merged
CodFrm merged 7 commits intoscriptscat:mainfrom Jun 14, 2025
Merged
Conversation
- 实现 用户可通过 `GM_registerMenuCommand` 方法在 `popup 页面`与脚本快捷输入交互 - 支持 `"text" | "number" | "boolean"` 三种交互方式 - 新增4个脚本猫独有的options可选字段 `inputType` `inputLabel` `inputDefaultValue` `inputPlaceholder` 用于控制 `popup` 交互界面 - 修复 `autoClose` 字段不生效的bug
CodFrm
reviewed
Jun 2, 2025
Member
|
菜单感觉不应该这么复杂 |
Contributor
Author
后台脚本没有可动态交互的方式,只能靠 |
Member
|
@DreamNya 相比这个,我觉得为CAT_userConfig加入一些动态交互更好,userConfig也是为了后台脚本配置诞生的 菜单这个我觉得有点难以接受,变得太复杂了,而且popup页面也很小,页面输入也受限制 |
Member
Contributor
Author
|
另外如果 |
Member
|
那就开一个新的API,例如: 另外这个 inputValue 记忆,提供一个输入值的参数(默认值),让用户/开发者使用GM_value或者其它去实现这个记忆更好吧 |
CodFrm
reviewed
Jun 14, 2025
| htmlType="submit" | ||
| icon={<IconMenu />} | ||
| title={menu.options?.title} | ||
| style={{ display: "block", width: "100%", borderTopColor: "#E5E6EB" }} |
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.


改动
CAT_registerMenuInput方法在popup 页面与脚本快捷输入交互(
CAT_registerMenuInput实际作为GM_registerMenuCommand别名,逻辑复用)"text" | "number" | "boolean"三种交互方式CAT_registerMenuInput.options可选字段inputTypeinputLabelinputDefaultValueinputPlaceholder用于控制popup交互界面GM_registerMenuCommand.options.autoClose字段不生效的bug预览
测试脚本
example\cat_bg_input_menu.jsTODO
selcetradiocheckbox等- [x] 输入内容存储