下一集快捷键

欧乐iyf"]"下一集快捷键

// ==UserScript==
// @name         下一集快捷键
// @namespace    https://github.com/tonylou7/olvod_next
// @version      2024-07-23
// @description  欧乐iyf"]"下一集快捷键
// @author       TonyLou
// @match        *://*.olevod.com/player/vod/*
// @match        *://*.iyf.tv/play/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {

    function clickElement(selector) {
        let el = document.querySelector(selector);
        if (el){
            el.click();
        }
    }

    var nextEl;
     // Check which website is currently loaded
    if (window.location.href.includes('olevod.com')) {
        nextEl = "#playerBoxTop > div > div > div > div.container > div > div.plyr__controls > div.plyr__controls__item.plyr__volume > div > div > div:nth-child(2) > div"
    } else if (window.location.href.includes('iyf.tv')) {
        nextEl = "#main-player > vg-controls.bg-overlayer > div.control-left.ng-star-inserted > div.play-next.control-item.ng-star-inserted > div"
    }

    document.addEventListener('keydown', function(e) {
        if (e.key === ']') {
            //e.preventDefault();
            clickElement(nextEl);
        }
    }, false);


})();