您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Keeps you in Google cache when you click links on cached pages.
当前为
// ==UserScript== // @name StayCached // @namespace mailto:[email protected] // @author Szop Gracz // @description Keeps you in Google cache when you click links on cached pages. // @match *://webcache.googleusercontent.com/* // @version 1.2.2 // ==/UserScript== const enabled_protocols = ['http','https','ftp','ftps']; const cache_header = document.getElementById('google-cache-hdr'); document.body.addEventListener('click', function(e) { var target = e.target || e.srcElement; if ( !target || cache_header.contains(target) ) return; while ( !target.href && target.parentNode ) target = target.parentNode; if ( target.href && enabled_protocols.indexOf(target.href.substr(0,target.href.search(':')))>=0 && !target.href.match('^https://webcache.googleusercontent.com/') && !target.href.match('^http://webcache.googleusercontent.com/') ) target.href = location.protocol + '//webcache.googleusercontent.com/search?q=cache:' + encodeURIComponent(target.href); } );