Last active
December 13, 2021 11:28
-
-
Save and-rom/6410c82f14c66711abfda7f0fa1cb5c0 to your computer and use it in GitHub Desktop.
Revisions
-
and-rom revised this gist
May 21, 2020 . 2 changed files with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ // ==UserScript== // @name AliExpress Links Change // @namespace https://gist.github.com/and-rom/6410c82f14c66711abfda7f0fa1cb5c0 // @version 0.5 // @author and-rom // @description Change links domain from .ru to .com // @homepage https://gist.github.com/and-rom/6410c82f14c66711abfda7f0fa1cb5c0 This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ // ==UserScript== // @name AliExpress Links Change // @namespace https://gist.github.com/and-rom/6410c82f14c66711abfda7f0fa1cb5c0 // @version 0.5 // @author and-rom // @description Change links domain from .ru to .com // @homepage https://gist.github.com/and-rom/6410c82f14c66711abfda7f0fa1cb5c0 -
and-rom revised this gist
May 21, 2020 . 2 changed files with 10 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,14 @@ // ==UserScript== // @name AliExpress Links Change // @namespace https://gist.github.com/and-rom/6410c82f14c66711abfda7f0fa1cb5c0 // @version 0.4 // @author and-rom // @description Change links domain from .ru to .com // @homepage https://gist.github.com/and-rom/6410c82f14c66711abfda7f0fa1cb5c0 // @icon https://ae01.alicdn.com/images/eng/wholesale/icon/aliexpress.ico // @icon64 https://ae01.alicdn.com/images/eng/wholesale/icon/aliexpress.ico // @updateURL https://gist.github.com/and-rom/6410c82f14c66711abfda7f0fa1cb5c0/raw/alilinkschange.meta.js // @downloadURL https://gist.github.com/and-rom/6410c82f14c66711abfda7f0fa1cb5c0/raw/alilinkschange.user.js // @match https://*.aliexpress.com/* // @match https://*.aliexpress.ru/* // @grant none This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,14 @@ // ==UserScript== // @name AliExpress Links Change // @namespace https://gist.github.com/and-rom/6410c82f14c66711abfda7f0fa1cb5c0 // @version 0.4 // @author and-rom // @description Change links domain from .ru to .com // @homepage https://gist.github.com/and-rom/6410c82f14c66711abfda7f0fa1cb5c0 // @icon https://ae01.alicdn.com/images/eng/wholesale/icon/aliexpress.ico // @icon64 https://ae01.alicdn.com/images/eng/wholesale/icon/aliexpress.ico // @updateURL https://gist.github.com/and-rom/6410c82f14c66711abfda7f0fa1cb5c0/raw/alilinkschange.meta.js // @downloadURL https://gist.github.com/and-rom/6410c82f14c66711abfda7f0fa1cb5c0/raw/alilinkschange.user.js // @match https://*.aliexpress.com/* // @match https://*.aliexpress.ru/* // @grant none -
and-rom revised this gist
May 21, 2020 . 2 changed files with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ // ==UserScript== // @name AliExpress Links Change // @namespace https://gist.github.com/androm/6410c82f14c66711abfda7f0fa1cb5c0 // @version 0.3 // @author and-rom // @description Change links domain from .ru to .com // @homepage https://gist.github.com/androm/6410c82f14c66711abfda7f0fa1cb5c0 This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ // ==UserScript== // @name AliExpress Links Change // @namespace https://gist.github.com/androm/6410c82f14c66711abfda7f0fa1cb5c0 // @version 0.3 // @author and-rom // @description Change links domain from .ru to .com // @homepage https://gist.github.com/androm/6410c82f14c66711abfda7f0fa1cb5c0 -
and-rom revised this gist
May 21, 2020 . 2 changed files with 19 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ // ==UserScript== // @name AliExpress Links Change // @namespace https://gist.github.com/androm/6410c82f14c66711abfda7f0fa1cb5c0 // @version 0.1 // @author and-rom // @description Change links domain from .ru to .com // @homepage https://gist.github.com/androm/6410c82f14c66711abfda7f0fa1cb5c0 // @icon https://ae01.alicdn.com/images/eng/wholesale/icon/aliexpress.ico // @icon64 https://ae01.alicdn.com/images/eng/wholesale/icon/aliexpress.ico // @updateURL https://gist.github.com/androm/6410c82f14c66711abfda7f0fa1cb5c0/raw/alilinkschange.meta.js // @downloadURL https://gist.github.com/androm/6410c82f14c66711abfda7f0fa1cb5c0/raw/alilinkschange.user.js // @match https://*.aliexpress.com/* // @match https://*.aliexpress.ru/* // @grant none // ==/UserScript== This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,14 @@ // ==UserScript== // @name AliExpress Links Change // @namespace https://gist.github.com/androm/6410c82f14c66711abfda7f0fa1cb5c0 // @version 0.1 // @author and-rom // @description Change links domain from .ru to .com // @homepage https://gist.github.com/androm/6410c82f14c66711abfda7f0fa1cb5c0 // @icon https://ae01.alicdn.com/images/eng/wholesale/icon/aliexpress.ico // @icon64 https://ae01.alicdn.com/images/eng/wholesale/icon/aliexpress.ico // @updateURL https://gist.github.com/androm/6410c82f14c66711abfda7f0fa1cb5c0/raw/alilinkschange.meta.js // @downloadURL https://gist.github.com/androm/6410c82f14c66711abfda7f0fa1cb5c0/raw/alilinkschange.user.js // @match https://*.aliexpress.com/* // @match https://*.aliexpress.ru/* // @grant none -
and-rom created this gist
May 21, 2020 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,67 @@ // ==UserScript== // @name AliExpress Links Change // @namespace https://gist.github.com/androm/[gist_id] // @version 0.1 // @author and-rom // @description Change links domain from .ru to .com // @homepage https://gist.github.com/androm/[gist_id] // @icon https://ae01.alicdn.com/images/eng/wholesale/icon/aliexpress.ico // @icon64 https://ae01.alicdn.com/images/eng/wholesale/icon/aliexpress.ico // @updateURL https://gist.github.com/androm/[gist_id]/raw/[file_name].meta.js // @downloadURL https://gist.github.com/androm/[gist_id]/raw/[file_name].user.js // @match https://*.aliexpress.com/* // @match https://*.aliexpress.ru/* // @grant none // ==/UserScript== (function() { 'use strict'; function go(links) { links.forEach(function(link){ if (link.hasAttribute("href")) { //console.log(link.getAttribute("href")); link.setAttribute("href", link.getAttribute("href").replace("aliexpress.ru", "aliexpress.com")); //console.log(link.getAttribute("href")); } }); } function setObserver() { var MutationObserver = window.MutationObserver || window.WebKitMutationObserver; var observer = new MutationObserver(function(mutations, observer) { mutations.forEach(function( mutation ) { var newNodes = mutation.addedNodes; if (newNodes !== null && newNodes.length !== 0 && mutation.target.tagName !== "EM") { // If there are new nodes added //console.log(mutation); //console.log(newNodes); newNodes.forEach(function( newNode ) { if (newNode.nodeName === "#text" || newNode.nodeName === "#comment") return; var links = newNode.querySelectorAll('a'); if (links.length !== 0) go(links); //console.log(links); }); } }); }); observer.observe(document, { childList: true, subtree: true }); } document.addEventListener('keydown', function(e) { if (e.altKey) { var code = (e.keyCode ? e.keyCode : e.which); if (code == 82) { go(document.querySelectorAll('a')); } // Alt + r } }); var interval = setInterval(function() { if(document.readyState === 'complete') { clearInterval(interval); setObserver(); go(document.querySelectorAll('a')); } }, 100); })();