From 12352cde501e71668b40a6ab485142cfad4eb8be Mon Sep 17 00:00:00 2001 From: EduarteXD Date: Sun, 4 May 2025 19:43:51 +0800 Subject: [PATCH] feat: add postMessage for toggling SC-BOX translate --- core.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core.ts b/core.ts index 0d5d79c..322ac4f 100644 --- a/core.ts +++ b/core.ts @@ -255,11 +255,13 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { if (SCLocalizationTranslating) { SCLocalizationTranslating = false; undoTranslate(); + window.postMessage({ type: 'TOGGLED-SC-BOX-TRANSLATE', action: 'off' }, '*'); return; } SCLocalizationTranslating = true; SCLocalizationEnableSplitMode = true; WebLocalizationUpdateReplaceWords(request.data); + window.postMessage({ type: 'TOGGLED-SC-BOX-TRANSLATE', action: 'on' }, '*'); } });