"do note you have to press the translate button" But there is a problem - i can't press the translate button because I do not see any button. (maybe it just doesn't work for me). I made script below with using chatgpt, just enabled the right click to have possibility to press THE TRANSLATION BUTTON.
// ==UserScript== // @name Qidian.com Translator and Right Click Enabler // @namespace http://tampermonkey.net/ // @version 1.0 // @description Enable Google Translate and right-click context menu on qidian.com // @author Your Name // @match *://*.qidian.com/* // @grant none // ==/UserScript==
(function() { 'use strict';
function enableFeatures() {
let htmlTag = document.documentElement; htmlTag.setAttribute("translate", "yes"); htmlTag.classList.remove("notranslate");
"do note you have to press the translate button" But there is a problem - i can't press the translate button because I do not see any button. (maybe it just doesn't work for me). I made script below with using chatgpt, just enabled the right click to have possibility to press THE TRANSLATION BUTTON.
// ==UserScript==
// @name Qidian.com Translator and Right Click Enabler
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Enable Google Translate and right-click context menu on qidian.com
// @author Your Name
// @match *://*.qidian.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
function enableFeatures() {
let htmlTag = document.documentElement;
htmlTag.setAttribute("translate", "yes");
htmlTag.classList.remove("notranslate");
document.addEventListener('contextmenu', function(e) {
e.stopImmediatePropagation();
}, true);
document.querySelectorAll('*').forEach(function(element) {
element.addEventListener('contextmenu', function(e) {
e.stopImmediatePropagation();
}, true);
});
}
window.addEventListener('load', enableFeatures);
const observer = new MutationObserver(enableFeatures);
observer.observe(document.body, { childList: true, subtree: true });
})();