您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Open redirected/cloaked links directly
当前为
- // ==UserScript==
- // @name Decloak links and open directly
- // @description Open redirected/cloaked links directly
- // @version 1.1.2
- // @author wOxxOm
- // @namespace wOxxOm.scripts
- // @icon https://i.imgur.com/cfmXJHv.png
- // @license MIT License
- // @run-at document-start
- // @match *://*/*
- // ==/UserScript==
- /* jshint lastsemic:true, multistr:true, laxbreak:true, -W030, -W041, -W084 */
- window.addEventListener('mousedown', decloak, true);
- window.addEventListener('keydown', function(e) { if (e.keyCode == 13) decloak(e) }, true);
- function decloak(e) {
- var a = e.target.closest('a');
- if (!a || !a.href.match(/^(http|ftp)/))
- return;
- if (e.altKey)
- return console.debug('Decloak skipped: Alt key is pressed.');
- if (location.hostname.indexOf('yandex.') >= 0) {
- a.onmousedown = null;
- a.onclick = null;
- }
- var m = a.href.match(/=(\w+(?::\/\/|%3[Aa]%2[Ff]%2[Ff])[^+&?]+)/);
- if (!m) {
- return;
- }
- var realUrl = decodeURIComponent(m[1]);
- if (new URL(realUrl).hostname == a.hostname)
- return console.debug('Decloak skipped: the hostnames are same, assumed a login redirection.');
- a.href = realUrl;
- }