We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
期望修复注册顺序和点击回调无效的问题
注册菜单 => test1->test2->test3 ↓ 卸载菜单 ↓ 注册菜单 => test2->test3->test1
test1
test2
test3
问题:在最后注册完菜单完成后,菜单顺序不同,且菜单test2和test3的点击事件不触发,只有test1的点击事件触发 该测试在Edge+TamperMonkey BETA 5.1.6193下又是正常的
Edge
TamperMonkey BETA 5.1.6193
// ==UserScript== // @name Debug GM_registerMenuCommand // @version 0.1 // @author WhiteSevs // @match *://*/* // @run-at document-start // @grant GM_registerMenuCommand // @grant GM_unregisterMenuCommand // ==/UserScript== (function () { const menuIdMap = {}; const menuList = [ { text: "test1", callback(event) { console.log(`test1 click`, event); }, }, { text: "test2", callback(event) { console.log(`test2 click`, event); }, }, { text: "test3", callback(event) { console.log(`test3 click`, event); }, }, ]; function register() { menuList.forEach((item) => { let menuId = GM_registerMenuCommand(item.text, item.callback); menuIdMap[menuId] = item; }); } function unRegister() { for (const key in menuIdMap) { GM_unregisterMenuCommand(key); } } register(); unRegister(); register(); })();
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Expected Behavior
期望修复注册顺序和点击回调无效的问题
Actual Behavior
注册菜单 =>
test1
->test2
->test3
↓
卸载菜单
↓
注册菜单 =>
test2
->test3
->test1
问题:在最后注册完菜单完成后,菜单顺序不同,且菜单
test2
和test3
的点击事件不触发,只有test1
的点击事件触发该测试在
Edge
+TamperMonkey BETA 5.1.6193
下又是正常的Specifications
Script
The text was updated successfully, but these errors were encountered: