diff --git a/doc/description.md b/doc/description.md index 928c46f0..8d357fb6 100644 --- a/doc/description.md +++ b/doc/description.md @@ -19,6 +19,8 @@ Mouseover Translate Any Language At Once English, Russian, Japanese, Chinese and so on # Change Log +- 0.1.120 + - fix bard text writing (request by Enlight432) - 0.1.119 - fix ocr build conflict - 0.1.118 diff --git a/src/contentScript.js b/src/contentScript.js index 3a83be77..637e0f8c 100644 --- a/src/contentScript.js +++ b/src/contentScript.js @@ -340,17 +340,20 @@ async function makeNonEnglishTypingFinish() { } async function insertText(text) { + var writingBox = util.getFocusedWritingBox(); if (!text) { return; - } - if (util.isGoogleDoc()) { + } else if (util.isGoogleDoc()) { pasteTextGoogleDoc(text); + } else if ($(writingBox).is("[data-gramm='false']")) { + //for bard website + document.execCommand("insertText", false, text); } else { pasteTextInputBox(text); - } - await delay(10); - if (hasSelection()) { - document.execCommand("insertText", false, text); + await delay(10); + if (hasSelection()) { + document.execCommand("insertText", false, text); + } } } @@ -646,7 +649,7 @@ function applyStyleSetting() { background-color: ${setting["tooltipBackgroundColor"]} !important; color: ${setting["tooltipFontColor"]} !important; overflow-wrap: break-word !important; - font-family: Arial !important; + font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important; border: 1px solid ${setting["tooltipBorderColor"]}; } [data-tippy-root] { diff --git a/src/util/index.js b/src/util/index.js index 7b0b6b7f..ce9337d2 100644 --- a/src/util/index.js +++ b/src/util/index.js @@ -1005,9 +1005,7 @@ export function getActiveElement(root = document) { if (!activeEl) { return null; - } - - if (activeEl.shadowRoot) { + } else if (activeEl.shadowRoot) { return getActiveElement(activeEl.shadowRoot); } else { return activeEl;