Greasy Fork

Greasy Fork is available in English.

AnimeFlV auto skip

This script will try to autoplay videos and also when its ending the episode, will reproduce next.

当前为 2024-08-06 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         AnimeFlV auto skip
// @namespace    https://grayapps.es/
// @version      0.0.1
// @description  This script will try to autoplay videos and also when its ending the episode, will reproduce next.
// @author       Javiergg
// @match        https://www3.animeflv.net/ver/*
// @icon         https://www3.animeflv.net/favicon.ico
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // Use Jquery
    var $ = window.jQuery;
    if (!$) {
        // Load jQuery if not available
        var script = document.createElement("script");
        script.src = "https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js";
        script.type = "text/javascript";
        document.getElementsByTagName("head")[0].appendChild(script);
    }



    // Function to handle received video data
    function handleVideoData(event) {
        if (event.data && event.data.type === 'VIDEO_DATA') {
            const videoData = event.data.data;
            if (videoData.currentTime > 0 && videoData.duration > 0) {
                if (videoData.currentTime / videoData.duration > 0.95){
                    console.log("play next!")
                    const btn = $('.CapNvNx');
                    if (btn.size()>0){
                        btn[0].click();
                    }
                }
            }
        }
    }

    // Listen for messages from other scripts
    window.addEventListener('message', handleVideoData);
})();