add context menus: open tranbox

This commit is contained in:
Gabe Yuan
2023-11-22 11:02:48 +08:00
parent f8bfcba317
commit 5bff84ace1
7 changed files with 37 additions and 2 deletions

View File

@@ -3,6 +3,7 @@ import {
MSG_TRANS_TOGGLE,
MSG_TRANS_TOGGLE_STYLE,
MSG_TRANSLATE_SELECTED,
MSG_OPEN_TRANBOX,
MSG_TRANS_GETRULE,
MSG_TRANS_PUTRULE,
} from "./config";
@@ -39,6 +40,9 @@ function runtimeListener(translator) {
case MSG_TRANSLATE_SELECTED:
window.dispatchEvent(new CustomEvent(MSG_TRANSLATE_SELECTED));
break;
case MSG_OPEN_TRANBOX:
window.dispatchEvent(new CustomEvent(MSG_OPEN_TRANBOX));
break;
default:
return { error: `message action is unavailable: ${action}` };
}