Hello. I wanted to translate the site into Russian via Tampermonkey, how to implement it? I tried everything, but something does not work

// ==UserScript== // @name TaORuS by LoyrLino // @namespace https://world.taobao.com // @version 0.0.1 // @description try to take over the world! // @author LoyrLino // @match *https://world.taobao.com* // @exclude *://taobao.com* // @grant none // ==/UserScript== $( "div.title text-16" ).replaceWith( "<h2>New heading</h2>" ); document.body.innerHTML = document.body.innerHTML.replace('ε•†ε“εˆ†η±»', 'AndryMan'); var b = document.getElementsByClassName("block2")[0], i = b.innerHTML; b.className = "block3"; alert(i); 

enter image description here

  • 2
    Replace the screenshot with a code. - user207618
  • Replaced with code. - LoyrLino
  • @Other help? - LoyrLino

1 answer 1

  1. There is no zhukveri on the site, so $(...).replaceWith(...) will not work.
  2. If you need to find an element with two classes, you need to write them like this: div.title.text-16 (without spaces, otherwise it will be interpreted as: "Find me a div with the class title and find an element with the class text-16 ).
  3. Replacing the whole body.innerHTML is one of the worst practices you can think of. Replace point.
  4. There are no elements with block2 class on the page.

Like that.