You + Google Menu

Adds a custom node to the Google menu

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         You + Google Menu
// @version      1.0
// @description  Adds a custom node to the Google menu
// @author       Your Name
// @match        https://vanced-youtube.neocities.org/2011/
// @run-at       document_end
// @license      MIT
// @namespace https://greasyfork.org/users/1090996
// ==/UserScript==

(function() {
    'use strict';

    // Create the new node
    var newNode = document.createElement('li');
    newNode.className = 'gbt';
    newNode.innerHTML = '<a onclick="gbar.qs(this)" class="gbzt" id="gb_2" href="http://www.google.com/imghp?hl=en&amp;tab=wi"><span class="gbtb2"></span><span class="gbts">+You</span></a>';

    // Find the reference node to insert before
    var referenceNode = document.querySelector('li.gbt a#gb_1');

    // Insert the new node before the reference node
    if (referenceNode && referenceNode.parentNode) {
        referenceNode.parentNode.insertBefore(newNode, referenceNode);
    }
})();