Greasy Fork

ds37自用油猴脚本

try to take over the world!

目前为 2020-05-10 提交的版本。查看 最新版本

// ==UserScript==
// @name         ds37自用油猴脚本
// @namespace    http://tampermonkey.net/
// @version      0.11
// @description  try to take over the world!
// @author       ds37
// @match        *.music.126.net/*
// @match        https://mmbiz.qpic.cn/*
// @match        https://mp.weixin.qq.com/*
// @match         *.dribbble.com/*
// @match         *.jianshu.io/*
// @match         *.tmall.com/*
// @match         https://login.taobao.com/member/login.jhtml*
// @match         https://cn.bing.com/*
// @grant        none
// ==/UserScript==


//右键在新标签中打开图片时显示最优化图像质量
//增加的,控制台测试有效,但是放在原作者js里面无效
//有两个原因,1是不能放在最后面,2是需要在脚本注释里面也加上适配网站

/*
var url = document.location.toString();
var m = null;
m = url.match(/^(https?:\/\/.+\.dribbble\.com\/)([\w\-\/]+)_(?:\w+)(\.(jpg|jpeg|gif|png|bmp|webp))$/i);
document.location = m[1] + m[2] + m[3];
浏览器控制台调试用。
*/

var url = document.location.toString();
var m = null;
var img = null;

//网易云音乐图片
if( (m = url.match(/^(https?:\/\/p\d?\.music\.126\.net\/.*==\/\d*(\.jpg)?)(\?param=\d*y\d*)$/i)) ) {
	document.location = m[1];
}

//https://detail.tmall.com/item.htm?spm=a1z10.3-b.w4011-4576207802.89.3ffe6c283xuI7K&id=606339945843&rn=251790cc7fcc948982bedb0906114d7a&abbucket=10&skuId=4422763215508
//天猫链接净化
else if( (m = url.match(/^(https?:\/\/.+\.tmall\.com\/item\.htm\?)(?:[\w\-\.\=]+&)(id=\d+)(&.*)$/i)) ) {
	document.location = m[1] + m[2];
}

//简书图片
//https://upload.jianshu.io/users/upload_avatars/10369183/1be8866e-5d8c-4930-9825-58d13e436fc3.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/240/h/240
//https://upload-images.jianshu.io/upload_images/4219043-25c53c817bc61247.png?imageMogr2/auto-orient/strip|imageView2/2/w/768/format/webp
else if( (m = url.match(/^(https?:\/\/.+\.jianshu\.io\/)([\w\-\/]+)(\.(jpg|jpeg|gif|png|bmp|webp))(?:\?imageMogr.*)$/i)) ) {
	document.location = m[1] + m[2] + m[3];
}

//知乎图片
//https://pic4.zhimg.com/v2-209419022f1c20ea05381da3273f1c57_r.jpg
//https://pic4.zhimg.com/v2-209419022f1c20ea05381da3273f1c57_xl.jpg

//dribbble图片
//https://cdn.dribbble.com/users/729829/screenshots/8070547/dribbble_1x.png
//https://cdn.dribbble.com/users/2811827/screenshots/7999487/black_squares.png
else if( (m = url.match(/^(https?:\/\/.+\.dribbble\.com\/)([\w\-\/]+)(?:_\w{1,2})(\.(jpg|jpeg|gif|png|bmp|webp))$/i)) ) {
	document.location = m[1] + m[2] + m[3];
}

//微信公众号网页图片
else if( (m = url.match(/^(https?:\/\/mmbiz.qpic.cn\/mmbiz_\w*\/.*\/640)(.+)$/i)) ) {
	document.location = m[1];
}

//https://mp.weixin.qq.com/s?__biz=MzI3NzkzNDcxOA==&mid=2247544667&idx=1&sn=d041d4bca03fee9a6c0c6045a048a1ea&chksm=eb5cc84adc2b415c28a1a92b7314cacc7e79d5c40e29fa42ac5c1c083f4901b435129c0bfd28&scene=27&subscene=10000&clicktime=1589133397&enterid=1589133397&ascene=0&devicetype=android-29&version=27000a11&nettype=WIFI&abtest_cookie=AAACAA%3D%3D&lang=zh_CN&exportkey=A9yslC9du78Owb2jxmG5BxQ%3D&pass_ticket=V0k7CVUu2YqxifhjJyDxZc1KRlUK0lGVIPjDo1LF1UDQVcspE1OQCAyYVqyjNRB3&wx_header=1
//微信公众号网页链接净化
else if( (m = url.match(/^(https?:\/\/mp.weixin.qq.com\/s\?__biz=)(.+)(&chksm=.+)$/i)) ) {
	document.location = m[1] + m[2];
}

//淘宝背景图片下载
else if( (m = url.match(/^(https:\/\/login\.taobao\.com\/member\/login\.jhtml)(.*)$/i)) ) {
    img = document.getElementsByClassName("login-newbg")[0].style.backgroundImage;
    img = img.match(/url\("(.*)"\)/)[1];
    window.open(img);
}


//必应背景图片下载
else if( (m = url.match(/^(https:\/\/cn\.bing\.com\/)(.*)$/i)) ) {
    img = document.getElementById("bgLink").href;
    window.open(img);
}