Google 好手氣直接跳轉至目標網頁

此腳本用於刪除前綴https://www.google.com/url?q= 並直接導向目標網址。(此腳本由ChatGPT協助撰寫)

当前为 2024-04-17 提交的版本,查看 最新版本

// ==UserScript==
// @name         Google 好手氣直接跳轉至目標網頁
// @namespace    https://github.com/jmsch23280866/
// @version      0.7
// @description  此腳本用於刪除前綴https://www.google.com/url?q= 並直接導向目標網址。(此腳本由ChatGPT協助撰寫)
// @author       特務E04
// @match        *://www.google.com/url?q=*
// @license      MIT
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // 檢查當前網址是否包含指定的前段
    if (window.location.href.startsWith("https://www.google.com/url?q=")) {
        // 將指定前段刪去並跳轉至剩餘的部分
        var url = window.location.href.replace("https://www.google.com/url?q=", "");
        window.location.replace(decodeURIComponent(url)); // 解碼網址中的特殊字符並使用 replace() 方法進行跳轉
    }
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址