Replaces mobile links on web pages with their desktop counterpart.
当前为
// ==UserScript==
// @name Mobile Link Replacer
// @namespace
// @version 0.3.4
// @description Replaces mobile links on web pages with their desktop counterpart.
// @author Spencer Ayers-Hale
// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt
// @match https://*/*
// @match http://*/*
// @exclude https://www.reddit.com/chat/minimize
// @exclude https://www.craigslist.org/static/www/localStorage*
// @exclude https://auth.discogs.com/*
// @exclude https://www.youtube.com/embed/*
// @exclude https://widget.pico.tools/*
// @exclude https://m.stripe.network/*
// ==/UserScript==
(function() {
'use strict';
var num = document.getElementsByTagName("a").length; //number of links on page
var cnt = 0; //current link number
var newLink;
while(cnt < num){
const link = document.getElementsByTagName("a")[cnt].href; //get orignal link
//find and replace
//Wikipedia
newLink = link.replaceAll(/m.wikipedia/gi, 'wikipedia');
//Facebook
newLink = newLink.replaceAll(/m.facebook/gi, 'facebook');
document.getElementsByTagName("a")[cnt].href=newLink; //write new link to page
cnt++;
}
})();