// ==UserScript== // @name 解除谷歌“手气不错”、知乎链接的重定向 // @name:zh-CN 解除谷歌“手气不错”、知乎链接的重定向 // @name:en-US Solve Google I'm Feeling Lucky Redirect Problem/ Zhihu Redirect Problem // @namespace SolveRedirect // @version 0.2 // @author Bilibili Up 漫游挨踢 // @include *google.com/* // @include *link.zhihu.com/* // @grant none // @description:zh-cn 谷歌手气不错以及知乎会阻止跳转网站,此脚本用于解决此问题。 // @description:en-US Google 's I'm feeling Lucky and Zhihu will cause redirect problem.This script will solve that. // @description 谷歌手气不错以及知乎会阻止跳转网站,此脚本用于解决此问题。 // @downloadURL none // ==/UserScript== (function() { 'use strict'; var a =""; //console.log("it works");alert("Hello World!"); if(location.href.match(/(https:\/\/www\.)?google\.com\/url\?q=http.+/)){ a = location.href; a=a.replace("https://www.google.com/url?q=",""); a=a.replace(/%25/g,"%"); location.href = a; } if(location.href.match(/(https:\/\/link\.)?zhihu\.com\/\?target=.+/)){ a = location.href; a=a.replace("https://link.zhihu.com/?target=","").replace("https%3A","https:"); a=a.replace(/%25/g,"%"); console.log(a); location.href = a; } // Your code here... })();