add command shortcuts & menu command

This commit is contained in:
Gabe Yuan
2023-08-21 14:03:39 +08:00
parent 6b30f443e1
commit 3c3ebdf96c
9 changed files with 54 additions and 1 deletions

View File

@@ -54,4 +54,14 @@ import { Translator } from "./libs/translator";
</CacheProvider>
</React.StrictMode>
);
// 注册菜单
GM.registerMenuCommand(
"Toggle Translate",
(event) => {
// console.log("Menu item selected", event);
translator.toggle();
},
"Q"
);
})();