您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Google搜尋結果的網址很冗長,將其縮短,方便複製、分享、儲存成乾淨的書籤
当前为
// ==UserScript== // @name 縮短Google網址 // @namespace https://gf.qytechs.cn/scripts/ // @version 0.1 // @description Google搜尋結果的網址很冗長,將其縮短,方便複製、分享、儲存成乾淨的書籤 // @author fmnijk // @match https://www.google.com*/* // @icon https://www.google.com/s2/favicons?domain=google.com // @grant none // @license MIT // @require https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js // ==/UserScript== (function() { 'use strict'; sturl(); window.addEventListener('locationchange', function (){ sturl(); }) })(); // shorten url function sturl() { var url = window.location.href; var qs = ['ved', 'uact', 'ie', 'oq', 'sclient', 'cshid', 'dpr', 'iflsig']; var nurl = rmqs(url, qs); if (url == nurl){ return false; } window.history.replaceState(null, null, nurl); } // remove not necessary query string function rmqs(url, qs) { url = new URL(url); qs.forEach(function(i){ url.searchParams.delete(i); }); return url.toString(); } /*----force listen to locationchange work start----*/ history.pushState = ( f => function pushState(){ var ret = f.apply(this, arguments); window.dispatchEvent(new Event('pushstate')); window.dispatchEvent(new Event('locationchange')); return ret; })(history.pushState); history.replaceState = ( f => function replaceState(){ var ret = f.apply(this, arguments); window.dispatchEvent(new Event('replacestate')); window.dispatchEvent(new Event('locationchange')); return ret; })(history.replaceState); window.addEventListener('popstate',()=>{ window.dispatchEvent(new Event('locationchange')) }); /*----force listen to locationchange work end----*/
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址