Greasy Fork

Change Logo Link

Change the logo link from "/" to "/home"

目前为 2024-10-13 提交的版本。查看 最新版本

// ==UserScript==
// @name         Change Logo Link
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Change the logo link from "/" to "/home"
// @match        *://*/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // Function to change the href attribute
    function changeLogoLink() {
        const logoAnchor = document.getElementById('logo');
        if (logoAnchor && logoAnchor.getAttribute('href') === '/') {
            logoAnchor.setAttribute('href', '/home');
            console.log('Logo link changed to /home');
        }
    }

    // Run the function after the page has loaded
    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', changeLogoLink);
    } else {
        changeLogoLink();
    }
})();