Answer the question
In order to leave comments, you need to log in
Google Chrome/Google Translate not translating popups now?
Wrote JS code that opened a popup window and filled it with text. Until recently, desktop Google Chrome successfully translated the text in these pop-up windows by RMB > "Translate to Russian". And some time ago I stopped translating. This RMB menu item in pop-up windows has disappeared. And even when installing the official Google Translate browser extension, it doesn't translate either: when you click "Translate page", nothing happens. And in the console there are no errors, nothing, silence. Those. in the main windows there is a translation, but in the pop-up windows there is no translation. I can not understand: the ban on the translation of pop-up windows is a fundamental change that appeared in one of the latest versions of Chrome? Or is this a problem specifically with my pop-up windows and, accordingly, the code that generates them?
let title = document.querySelector('head > title');
let text = document.querySelectorAll('p');
let text0 = '';
for (let text1 of text) {
text0 = text0 + text1.outerHTML;
}
let button1 = document.createElement('button');
button1.innerHTML = 'Открыть текст в новом окне';
button1.onclick = function() {
let text_window = window.open();
text_window.document.title = 'Текст: ' + title.innerHTML;
text_window.document.body.innerHTML = text0;
}
document.body.prepend(button1);
let button2 = document.createElement('button');
button2.innerHTML = 'Открыть текст в текущем окне';
button2.onclick = function() {
document.head.innerHTML = title.outerHTML;
document.body.innerHTML = text0;
}
button1.after(button2);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question