socram8888 / Untranslate eBay.es

// ==UserScript==
// @name        Untranslate eBay.es
// @description Removes the shitty autotranslation from eBay.es ad titles
// @version     1.0
// @copyright   2018, socram8888 (https://openuserjs.org/users/socram8888)
// @license     0BSD
// @namespace   socram8888
// @match       https://www.ebay.es/sch/*
// @match       https://www.ebay.es/itm/*
// @run-at      document-end
// @grant       none
// @updateURL   https://openuserjs.org/meta/socram8888/Untranslate_eBay.es.meta.js
// ==/UserScript==

// ==OpenUserJS==
// @author      socram8888
// ==/OpenUserJS==

if (window.location.pathname.startsWith("/sch/")) {
  var elems = document.body.querySelectorAll(".lvtitle > a");
  for (var i = 0; i < elems.length; i++) {
    if (elems[i].dataset.mtdes) {
      elems[i].innerText = elems[i].dataset.mtdes;
    }
  }
} else if (window.location.pathname.startsWith("/itm/")) {
  var title = document.querySelector(".it-ttl");
  if (title) {
    var origTitle = title.querySelector(".it-sttl");
    if (origTitle && origTitle.dataset.mtdes) {
      title.innerText = origTitle.dataset.mtdes;
    }
  }
}