访问新浪微博图片的URL时会自动跳转到原图
当前为
// ==UserScript==
// @name 微博原图
// @namespace http://tampermonkey.net/
// @version 0.14
// @description 访问新浪微博图片的URL时会自动跳转到原图
// @author halfasec
// @match *.sinaimg.cn/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
var princeLi=window.location.href;
console.log(princeLi);
var flagLarge=/thumbnail|thumb150|mw600|mw690|mw1024|small|bmiddle/.test(princeLi);
console.log(flagLarge);
if(flagLarge){
var catLi=princeLi.replace(/thumbnail|thumb150|mw600|mw690|mw1024|small|bmiddle/, "large");
console.log(catLi);
window.location.href=catLi;
}
window.addEventListener('keydown', event => {
if (event.keyCode == 115) { // F4
var detectiveBao="https://www.google.com/searchbyimage?safe=off&site=search&image_url="+window.location.href;
window.location.href=detectiveBao;
} });
})();