mirror of
https://ghfast.top/https://github.com/StarCitizenToolBox/StarCitizenBoxBrowserEx.git
synced 2025-05-09 21:51:25 +08:00
feat: add postMessage for toggling SC-BOX translate
This commit is contained in:
parent
78b138f039
commit
12352cde50
2
core.ts
2
core.ts
@ -255,11 +255,13 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
|||||||
if (SCLocalizationTranslating) {
|
if (SCLocalizationTranslating) {
|
||||||
SCLocalizationTranslating = false;
|
SCLocalizationTranslating = false;
|
||||||
undoTranslate();
|
undoTranslate();
|
||||||
|
window.postMessage({ type: 'TOGGLED-SC-BOX-TRANSLATE', action: 'off' }, '*');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SCLocalizationTranslating = true;
|
SCLocalizationTranslating = true;
|
||||||
SCLocalizationEnableSplitMode = true;
|
SCLocalizationEnableSplitMode = true;
|
||||||
WebLocalizationUpdateReplaceWords(request.data);
|
WebLocalizationUpdateReplaceWords(request.data);
|
||||||
|
window.postMessage({ type: 'TOGGLED-SC-BOX-TRANSLATE', action: 'on' }, '*');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user