Greasy Fork

Aliexpress: .ru links to .com

Use after setting english: https://webapps.stackexchange.com/a/153233

当前为 2021-08-10 提交的版本,查看 最新版本

// ==UserScript==
// @name         Aliexpress: .ru links to .com
// @namespace    tadoritz
// @description  Use after setting english: https://webapps.stackexchange.com/a/153233
// @version      0.1
// @match        https://*.aliexpress.ru/*
// @match        https://*.aliexpress.com/*
// @run-at       document-end
// ==/UserScript==

document.querySelectorAll(`
  /* some preselected links */
  .inside-page-logo a,
  .right-shopcart a,
  .nav-cart-box a,
  .ng-bp a,
  .nav-wishlist a,
  .flyout-quick-entry a,
  .ng-mobile a,
  .sf-aliexpressInfo a,
  .sf-seoKeyword a`).forEach(item => {
    item.href = item.href.replace(".ru", ".com");
});

// another variants:
//   `.inside-page-logo a[href*=".ru"], ...` - same result, but too much words
//   `a[href*=".ru"]` - apply to all links, may break some links