From ea098166f5b5f5a9a30e4c59fffde448d23ebaa3 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Sat, 7 Dec 2019 12:33:30 +0100 Subject: [PATCH] Update GoogleTranslateOption.plugin.js --- Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js b/Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js index 62ec70064b..604f61d51f 100644 --- a/Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js +++ b/Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js @@ -3,7 +3,7 @@ class GoogleTranslateOption { getName () {return "GoogleTranslateOption";} - getVersion () {return "1.7.8";} + getVersion () {return "1.7.9";} getAuthor () {return "DevilBro";} @@ -507,7 +507,7 @@ class GoogleTranslateOption { else { let googleTranslateWindow = BDFDB.WindowUtils.open(this, this.getGoogleTranslatePageURL(input.id, output.id, newtext)); googleTranslateWindow.webContents.on("did-finish-load", _ => { - googleTranslateWindow.webContents.executeJavaScript(`require("electron").ipcRenderer.sendTo(${BDFDB.LibraryRequires.electron.remote.getCurrentWindow().webContents.id}, "GTO-translation", [(document.querySelector(".translation span") || {}).innerHTML, [(new RegExp("{code:'([^']*)',name:'" + [(new RegExp((window.source_language_detected || "").replace("%1$s", "([A-z]{2,})"), "g")).exec(document.body.innerHTML)].flat()[1] +"'}", "g")).exec(document.body.innerHTML)].flat()[1]]);`); + googleTranslateWindow.webContents.executeJavaScript(`require("electron").ipcRenderer.sendTo(${BDFDB.LibraryRequires.electron.remote.getCurrentWindow().webContents.id}, "GTO-translation", [(document.querySelector(".translation") || {}).innerText, [(new RegExp("{code:'([^']*)',name:'" + [(new RegExp((window.source_language_detected || "").replace("%1$s", "([A-z]{2,})"), "g")).exec(document.body.innerHTML)].flat()[1] +"'}", "g")).exec(document.body.innerHTML)].flat()[1]]);`); }); BDFDB.WindowUtils.addListener(this, "GTO-translation", (event, data) => { googleTranslateWindow.close();