您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Redirect twimg to :orig
- // ==UserScript==
- // @name twimg redirect to original
- // @namespace https://mzile.net
- // @version 1.3.2
- // @description Redirect twimg to :orig
- // @author eai04191
- // @license MIT
- // @supportURL https://github.com/eai04191/twimg-redirect-to-original/issues
- // @match *://pbs.twimg.com/media/*
- // @exclude *://pbs.twimg.com/media/*name=orig
- // @run-at document-start
- // @grant none
- // ==/UserScript==
- //https://pbs.twimg.com/media/ABC.jpg:large
- //https://pbs.twimg.com/media/ABC?format=jpg&name=large
- var url = window.document.location + "";
- url = url.replace(/\?format=/, ".");
- url = url.replace(/\&name=/, ":");
- //https://pbs.twimg.com/media/ABC.jpg:large
- //https://pbs.twimg.com/media/ABC.jpg:large
- url = url.replace(/\.(?=[^.]*$)/, "?format=");
- //https://pbs.twimg.com/media/ABC?format=jpg:large
- url = url.replace( /(:large|:medium|:small|:orig|:thumb|:360x360|:900x900)/, "");
- //https://pbs.twimg.com/media/ABC?format=jpg
- window.location.replace( url + "&name=orig" );
- //https://pbs.twimg.com/media/ABC?format=jpg&name=orig