From 1af1c325a2725433a1ca2d69bab0feb22e43618a Mon Sep 17 00:00:00 2001 From: daniel k Date: Sun, 28 Jan 2024 11:52:53 +0900 Subject: [PATCH] refactor code --- src/contentScript.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/contentScript.js b/src/contentScript.js index 0b4751fb..2fc31cfd 100644 --- a/src/contentScript.js +++ b/src/contentScript.js @@ -296,7 +296,7 @@ async function translateWriting() { // if is google doc do not check writing box if ( !keyDownList[setting["keyDownTranslateWriting"]] || - (!util.getFocusedWritingBox() && !util.isGoogleDoc()) + !util.getFocusedWritingBox() ) { return; } @@ -351,14 +351,7 @@ async function makeNonEnglishTypingFinish() { async function insertText(text) { if (!text) { return; - } else if (util.isGoogleDoc()) { - pasteTextGoogleDoc(text); - } else { - pasteTextDom(text); } -} - -async function pasteTextDom(text) { pasteTextInputBox(text); await delay(10); if (hasSelection()) {