Greasy Fork

Greasy Fork is available in English.

TVer 自動で「詳細を見る」をクリック(SPA対応)

TVerの動画ページで「詳細を見る」ボタンを自動でクリック(タブ内遷移にも対応)

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         TVer 自動で「詳細を見る」をクリック(SPA対応)
// @namespace    https://tver.jp/
// @version      1.2
// @description  TVerの動画ページで「詳細を見る」ボタンを自動でクリック(タブ内遷移にも対応)
// @author       ChatGPT
// @match        https://tver.jp/episodes/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    let currentUrl = location.href;

    function clickDetailsButton() {
        const buttons = document.querySelectorAll('button');
        for (const btn of buttons) {
            if (btn.textContent.trim() === '詳細を見る') {
                console.log('「詳細を見る」ボタンをクリックします');
                btn.click();
                return true;
            }
        }
        return false;
    }

    function observeForDetailsButton() {
        const observer = new MutationObserver(() => {
            if (clickDetailsButton()) {
                observer.disconnect();
            }
        });

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

    function onUrlChange() {
        if (location.href !== currentUrl) {
            currentUrl = location.href;
            console.log('URLが変更されました。再確認します:', currentUrl);
            observeForDetailsButton();
        }
    }

    // 初期読み込み
    observeForDetailsButton();

    // URL変更監視(SPA対応)
    const urlObserver = new MutationObserver(onUrlChange);
    urlObserver.observe(document.body, {
        childList: true,
        subtree: true,
    });

    // pushState/replaceState のフックでURL変更検知を強化(必要に応じて)
    const originalPushState = history.pushState;
    const originalReplaceState = history.replaceState;

    history.pushState = function (...args) {
        originalPushState.apply(this, args);
        setTimeout(onUrlChange, 100);
    };

    history.replaceState = function (...args) {
        originalReplaceState.apply(this, args);
        setTimeout(onUrlChange, 100);
    };

    window.addEventListener('popstate', onUrlChange);
})();
// ==UserScript==
// @name        New script chatgpt.com
// @namespace   Violentmonkey Scripts
// @match       https://chatgpt.com/c/68020a4c-2a9c-8000-a36a-c6f647ce9e95*
// @grant       none
// @version     1.0
// @author      -
// @description 2025/4/18 17:29:02
// ==/UserScript==