Pornhub Intro Skip (Android)

Works with Hls.js mobile player on Firefox Android

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Pornhub Intro Skip (Android)
// @namespace    http://tampermonkey.net/
// @version      5.0
// @description  Works with Hls.js mobile player on Firefox Android
// @match        https://www.pornhub.com/*
// @grant        none
// @run-at       document-idle
// ==/UserScript==

(function() {
    'use strict';

    function hookVideo(video) {
        if (!video || video._skipHooked) return;
        video._skipHooked = true;

        let enforced = false;

        function enforce() {
            let start = performance.now();

            const interval = setInterval(() => {
                if (!video) return;

                // Force jump if still near start
                if (video.currentTime < 3) {
                    try {
                        video.currentTime = 3.05;
                    } catch (e) {}
                }

                // Stop after ~4 seconds
                if (performance.now() - start > 4000) {
                    clearInterval(interval);
                }
            }, 120);
        }

        // KEY: wait for actual playback progression
        video.addEventListener('timeupdate', () => {
            if (!enforced && video.currentTime > 0) {
                enforced = true;
                enforce();
            }
        });

        // Backup hooks
        video.addEventListener('playing', enforce);
        video.addEventListener('seeking', () => {
            if (video.currentTime < 3) {
                video.currentTime = 3.05;
            }
        });
    }

    function findAndHook() {
        const videos = document.querySelectorAll('video');
        videos.forEach(v => hookVideo(v));
    }

    // Continuous scan (needed for dynamic mobile player)
    const observer = new MutationObserver(findAndHook);
    observer.observe(document.documentElement, {
        childList: true,
        subtree: true
    });

    // Also run periodically (fallback)
    setInterval(findAndHook, 1000);

    // Required for Firefox Android: wait for user interaction
    function activate() {
        setTimeout(findAndHook, 300);
    }

    document.addEventListener('touchstart', activate, { once: true });
    document.addEventListener('click', activate, { once: true });

})();