Skip to content

Instantly share code, notes, and snippets.

@cheebow
Last active August 24, 2023 06:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cheebow/bfa3764395bf483740e662a2054ccf40 to your computer and use it in GitHub Desktop.
Save cheebow/bfa3764395bf483740e662a2054ccf40 to your computer and use it in GitHub Desktop.
[改][改]Google翻訳でページを翻訳すると語順がめちゃくちゃになるのを回避するブックマークレット(オリジナル:https://penpen-dev.com/blog/google/)
javascript:document.querySelectorAll('code').forEach(function(e)%7Bif(e.closest('pre'))%7Breturn%3B%7Dconst newElem%3Ddocument.createElement('span')%3Bwhile(e.firstChild)%7BnewElem.appendChild(e.firstChild)%3B%7Dfor(let index%3De.attributes.length - 1%3Bindex>%3D0%3B--index)%7BnewElem.attributes.setNamedItem(e.attributes%5Bindex%5D.cloneNode())%3B%7De.parentNode.replaceChild(newElem%2Ce)%3B%7D)%3Bvoid(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment