Greasy Fork 支持简体中文。

收起 Felo Search 侧边栏

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

// ==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);
})();