收起 Felo Search 侧边栏

启动 Felo Search 后自动收起侧边栏

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

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 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         收起 Felo Search 侧边栏
// @namespace    http://tampermonkey.net/
// @version      0.5
// @icon         https://www.google.com/s2/favicons?sz=64&domain=felo.ai
// @description  启动 Felo Search 后自动收起侧边栏
// @author       Jing Wang
// @contact      [email protected]
// @license      GPL-3.0
// @match        https://felo.ai/search*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Function to click the sidebar toggle button
    function closeSidebar() {
        const sidebarToggle = document.querySelector('section.hidden.md\\:block.cursor-pointer');
        if (sidebarToggle) {
            sidebarToggle.click();
        }
    }

    // Run the function when the page loads
    window.addEventListener('load', closeSidebar);

    // // Also run the function periodically in case the button is added dynamically
    // setInterval(closeSidebar, 2000);
})();