Greasy Fork

imageresizer

Script to resize images on various images

当前为 2017-10-15 提交的版本,查看 最新版本

// ==UserScript==
// @name        imageresizer
// @namespace   Javascript
// @description Script to resize images on various images
// @include     *//pbs.twimg.com/media/*
// @include     *//images-na.ssl-images-amazon.com/*
// @include     *//shopping.toei-anim.co.jp/system-img/*
// @include     *//bandai-a.akamaihd.net/*
// @include     *.media.tumblr.com/*
// @include     *i.ebayimg.com/*
// @include     *whstatic.com/*
// @include     *wikimon.net/*
// @version     1
// @grant       none
// ==/UserScript==

if(window.location.href.match(/(pbs\.twimg\.com\/media\/[^.]+\.(jpg|png|gif))(:large)?(?!:orig)/))
{window.location.href=window.location.href.replace(/(pbs\.twimg\.com\/media\/[^.]+\.(jpg|png|gif))(:large)?(?!:orig)/, "$1:orig")};

if(window.location.href.match(/images-na\.ssl-images-amazon\.com\/images\/(.+)\._[A-z][A-z][0-9]+_\.(.+)$/))
{window.location.href=window.location.href.replace(/images-na\.ssl-images-amazon\.com\/images\/(.+)\._[A-z][A-z][0-9]+_\.(.+)$/, "images-na\.ssl-images-amazon\.com\/images\/$1\.$2")};

if(!window.location.href.match(/shopping\.toei-anim\.co\.jp\/system-img\/0\/0(\/.+$)/))
{if(window.location.href.match(/shopping\.toei-anim\.co\.jp\/system-img\/[0-9]+\/[0-9]+(\/.+$)/))
{window.location.href=window.location.href.replace(/shopping\.toei-anim\.co\.jp\/system-img\/[0-9]+\/[0-9]+(\/.+$)/, "shopping.toei-anim.co.jp/system-img/0/0$1")}}

if(!window.location.href.match(/bandai-a\.akamaihd\.net\/bc\/img\/model\/xl\//))
{if(window.location.href.match(/bandai-a\.akamaihd\.net\/bc\/img\/model\/[A-z][A-z]?\//))
{window.location.href=window.location.href.replace(/bandai-a\.akamaihd\.net\/bc\/img\/model\/[A-z][A-z]?\//, "bandai-a.akamaihd.net/bc/img/model/xl/")}}

if(!window.location.href.match(/media\.tumblr\.com\/([^\/]+)\/?([^\.]+_)1280/))
{
  
  if(window.location.href.match(/media\.tumblr\.com\/[^\/]+\/?[^\.]+_[0-9]+(\.jpg|.\png|\.gif)/))
{
  //alert("hop")
  window.location.href=window.location.href.replace(/media\.tumblr\.com\/([^\/]+\/?[^\.]+_)[0-9]+(\.jpg|.\png|\.gif)/, "media.tumblr.com/$11280$2")}}

if(!window.location.href.match(/i\.ebayimg\.com\/images\/[a-z]\/[^\/]+\/s-l9999\.png/))
{if(window.location.href.match(/i\.ebayimg\.com\/images\/[a-z]\/[^\/]+\/s-l[0-9]+/))
{window.location.href=window.location.href.replace(/s-l[0-9]+\.jpg/,"s-l9999.png")}}


if((window.location.href.match(/whstatic\.com/) || window.location.href.match(/wikimon\.net/)) && window.location.href.match(/thumb/))
  {
    window.location.href=window.location.href.replace(/\/[^\/]+$/,"").replace(/thumb\//,"")
  }