Created
August 16, 2021 08:02
-
-
Save vhxubo/a5ce83f3634d4073eaef52e6e0ce6822 to your computer and use it in GitHub Desktop.
Don't translate <pre> by Google Translate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Don't translate <pre> | |
// @namespace https://gist.github.com/vhxubo/a5ce83f3634d4073eaef52e6e0ce6822 | |
// @version 0.1 | |
// @description Don't translate <pre> by Google Translate | |
// @author vhxubo | |
// @match *://*/* | |
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// https://html.spec.whatwg.org/multipage/dom.html#the-translate-attribute | |
var allPre = document.getElementsByTagName("pre"); | |
for(var i = 0; i < allPre.length; i++){ | |
allPre[i].setAttribute("translate","no"); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment