Greasy Fork

Greasy Fork is available in English.

哔哩哔哩(bilibili.com)番剧跳过片头

片头开始播放时,按 J 键跳过片头

当前为 2019-01-31 提交的版本,查看 最新版本

// ==UserScript==
// @name         哔哩哔哩(bilibili.com)番剧跳过片头
// @namespace    http://tampermonkey.net/
// @version      0.923
// @description  片头开始播放时,按 J 键跳过片头
// @author       zhpjy
// @match        *://www.bilibili.com/*
// @icon         https://www.bilibili.com/favicon.ico
// @grant        none
// @license     WTFPL
// ==/UserScript==

var keyCode = 74; // 键码
var OPTime = 90; //片头长度
var RecTime = 1; //反应时间

var isJumped = false;
$(document).keydown(function(event){
    if(event.keyCode == keyCode && !isJumped ){
        var video = $('.bilibili-player-video video')[0];
        if(video.currentTime>0){
            video.currentTime += (OPTime-RecTime);
        }else{
            video.currentTime += OPTime;
            video.play();
        }
        isJumped = true;
    }
});