Remove Highlight Text Fragment

A Tampermonkey userscript to automatically remove highlight fragments from Google/Bing search results

当前为 2022-07-24 提交的版本,查看 最新版本

// ==UserScript==
// @name         Remove Highlight Text Fragment
// @namespace    https://github.com/Drakmyth/remove-highlight-text-fragment
// @version      0.1
// @author       Drakmyth
// @description  A Tampermonkey userscript to automatically remove highlight fragments from Google/Bing search results
// @homepage     https://github.com/Drakmyth/remove-highlight-text-fragment
// @supportURL   https://github.com/Drakmyth/remove-highlight-text-fragment/issues
// @license      MIT
// @match        *://*/*
// @run-at       document-start
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const navigationEntries = performance.getEntriesByType("navigation");
    if (navigationEntries.length <= 0) return;

    for (let entry of navigationEntries) {
        const parsed_url = entry.name.split('#:~:text');
        if (parsed_url.length > 1) {
            console.log(`Highlight fragment found! Redirecting to ${parsed_url[0]}`);
            window.location=parsed_url[0];
        }
    }
})();

QingJ © 2025

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