// ==UserScript== // @name ds37自用油猴脚本 // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author ds37 // @match *.music.126.net/* // @match https://mmbiz.qpic.cn/* // @match *.dribbble.com/* // @match *.jianshu.io/* // @match *.tmall.com/* // @match https://login.taobao.com/member/login.jhtml* // @match https://cn.bing.com/* // @grant none // @downloadURL 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]; } //淘宝背景图片下载 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); }