feat: add postMessage for toggling SC-BOX translate

This commit is contained in:
EduarteXD 2025-05-04 19:43:51 +08:00
parent 78b138f039
commit 12352cde50

View File

@ -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' }, '*');
}
});