Skip to content

Commit

Permalink
Update script.js
Browse files Browse the repository at this point in the history
Tried window name and window target for translation.
  • Loading branch information
unhandyandy authored Sep 1, 2024
1 parent f207f8a commit d0a452d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions annotationAid/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ function highlight(text) {
// newurl = new URL("https://www.mdbg.net/chinese/dictionary?page=worddict&wdqb="+text+"&wdrst=1");
const searchterm = searchStr.replace("${text}",text);
newurl = new URL(searchterm);
transCh.postMessage(JSON.stringify(newurl));
// transCh.postMessage(JSON.stringify(newurl));
window.open(newurl,"TranslationWindow");

const red = getWordFreqColor(text);
const beg = (notesDiv.innerHTML==="") ? "" : "<br>";
Expand Down Expand Up @@ -420,7 +421,10 @@ function colorAllChars(){
}}

function openTranslationWindow(){
window.open("translation.html","TranslationWindow", "width=500, height=600"); }
const newin = window.open("translation.html","TranslationWindow", "width=500, height=600");
if(newwin){
newwin.name = "TranslationWindow"; }
}

// function openSettingsDialog(){
// const form = document.createElement("form");
Expand Down

0 comments on commit d0a452d

Please sign in to comment.