-
Notifications
You must be signed in to change notification settings - Fork 310
重构菜单消息推送代码 #837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
重构菜单消息推送代码 #837
Conversation
|
不用改 GM_registerMenuCommand("菜单", () => {
console.log("应该只输出一次");
}, {id: "menu-01"})
GM_registerMenuCommand("菜单", () => {
console.log("应该只输出一次");
}, {id: "menu-01"})
GM_registerMenuCommand("菜单", () => {
console.log("应该只输出一次");
}, {id: "menu-01"})
GM_registerMenuCommand("菜单", () => {
console.log("应该只输出一次");
}, {id: "menu-01"})
GM_registerMenuCommand("菜单", () => {
console.log("应该只输出一次");
}, {id: "menu-01"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
請關掉 PR 837
請刪掉 每一个iframe只触发一次 的部份
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有看到其他代码改善。
单项目能执行多个是故意的
不然iframe 那些执行不了
如果用户希望的是更新之前的项目,应该是由用户自己把 id 加入到API而不是ScriptCat自行处理
这个设计是来自
violentmonkey/violentmonkey#1928
Tampermonkey/tampermonkey#1865
如果 不同 frame 的能执行多个
同一 frame 的加了没反应
更奇怪
现有的options已经可以完全解决这些问题
唉,你说得也有道理,有点不习惯了,我删除这个逻辑吧 |
|
另外提一个问题 menu资讯有记录 windowId ? |
|
我觉得你还是先发布一下 1.2 吧 |
我测试了一下,可以正常执行,发消息的时候也没有指定windowId
还有些问题没有修复,发布1.2还要一些时间,不是新增功能,合进去也没问题 |
概述
#790 (comment)
变更内容
截图