c.Ai Search Expander

Automatically expands search results on c.Ai

// ==UserScript==
// @name         c.Ai Search Expander
// @namespace    https://gf.qytechs.cn/users/1084087-fermion
// @version      1.0
// @description  Automatically expands search results on c.Ai
// @author       ashley
// @match        https://character.ai/*
// @icon         https://c.ai/static/images/favicon.ico
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    function expandSearchResults() {
        const loadMoreButton = document.querySelector('.search-load-more');
        if (loadMoreButton) {
            loadMoreButton.click();
            setTimeout(expandSearchResults, 500); // Wait 0.5 seconds before checking again
        }
    }

    // Wait for the search results to appear, then start expanding them
    const observer = new MutationObserver((mutations) => {
        mutations.forEach((mutation) => {
            if (mutation.type === 'childList' && document.querySelector('.search-load-more')) {
                expandSearchResults();
                observer.disconnect(); // Stop observing once we've started expanding
            }
        });
    });

    observer.observe(document.body, { childList: true });
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址