您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
Automatically redirect from mobile webpages to the non-mobile equivalent
当前为
// ==UserScript== // @name This Ain't A Phone // @namespace https://schiff.io // @version 5 // @description Automatically redirect from mobile webpages to the non-mobile equivalent // @author Hayden Schiff (oxguy3) // @match *://m.facebook.com/* // @match *://mobile.nytimes.com/* // @match *://mobile.twitter.com/* // @match *://*.m.wikipedia.org/* // @match *://m.xkcd.com/* // @grant none // @run-at document-start // ==/UserScript== (function() { 'use strict'; // Checks if the location is a mobile site, and returns the URL of the non-mobile equivalent // Params: loc: window.location // Returns: string of new URL, or false if no match function checkLocation(loc) { var destination = false; // Facebook if (loc.host == 'm.facebook.com') { destination = loc.href.replace(/\/\/m\.facebook\.com/i, '//www.facebook.com'); } // New York Times if (loc.host == 'mobile.nytimes.com') { destination = loc.href.replace(/\/\/mobile\.nytimes\.com/i, '//www.nytimes.com'); } // Twitter if (loc.host == 'mobile.twitter.com') { destination = loc.href.replace(/\/\/mobile\.twitter\.com/i, '//twitter.com'); } // Wikipedia if (loc.host.endsWith('.m.wikipedia.org')) { destination = loc.href.replace(/\.m\.wikipedia\.org/i, '.wikipedia.org'); } // xkcd if (loc.host == 'm.xkcd.com') { destination = loc.href.replace(/\/\/m\.xkcd\.com/i, '//xkcd.com'); } return destination; } var destination = checkLocation(window.location); if (destination !== false) { window.location.href = destination; } })();