Opens “Tools” Menu by Default on Google

Opens the “Tools” menu on Google Search automatically when page loaded.

Verze ze dne 18. 02. 2023. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name               Opens “Tools” Menu by Default on Google
// @name:zh-TW         預設開啟 Google 的「工具」選單
// @description        Opens the “Tools” menu on Google Search automatically when page loaded.
// @description:zh-TW  在 Google 搜尋載入後自動打開「工具」選單。
// @icon               https://wsrv.nl/?url=https://www.google.com/images/branding/googleg/1x/googleg_standard_color_128dp.png
// @author             Jason Kwok
// @namespace          https://jasonhk.dev/
// @version            1.0.0
// @license            MIT
// @match              https://www.google.com/search
// @run-at             document-end
// @grant              none
// ==/UserScript==

const toolsButton = document.querySelector("#hdtb-tls, [jsname=I4bIT], [jscontroller=LbcJwc]");
if (toolsButton)
{
    const interval = setInterval(() =>
    {
        if (toolsButton.getAttribute("aria-expanded") !== "true")
        {
            toolsButton.click();
        }
        else
        {
            clearInterval(interval);
        }
    }, 250);
}