您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
解除尔雅通识课在自动暂停播放的限制并添加自动播放下一集的功能
当前为
// ==UserScript== // @name Fuck Erya // @namespace [email protected] // @description 解除尔雅通识课在自动暂停播放的限制并添加自动播放下一集的功能 // @author 依然独特 // @version 0.1.7 // @grant none // @run-at document-start // @include *://*.tsk.erya100.com/courseAction!toCourseVideo* // @include *://*.tsk*.erya100.com/courseAction!toCourseVideo* // @match *://*.tsk.erya100.com/courseAction!toCourseVideo* // @match *://*.tsk*.erya100.com/courseAction!toCourseVideo* // @license BSD 2-Clause License // @homepageURL https://gist.github.com/xuyiming-open/79e80a9322d7a1f35f16 // ==/UserScript== "use strict"; ( function() { var Hooks = { "fn": function fn( fn, onInvoke ) { "use strict"; return function() { return onInvoke.call( this, fn, arguments ); }; }, "property": function property( object, propertyName, onGet, onSet ) { "use strict"; var descriptor, value, getter; if ( Object.prototype.hasOwnProperty.call( object, propertyName ) ) { descriptor = Object.getOwnPropertyDescriptor( object, propertyName ); if ( Object.prototype.hasOwnProperty.call( descriptor, "value" ) ) { value = descriptor.value; delete descriptor.value; delete descriptor.writable; } else if ( Object.prototype.hasOwnProperty.call( descriptor, "get" ) && Object.prototype.hasOwnProperty.call( descriptor, "set" ) ) { value = getter.call( this ); } descriptor.get = function get() { return onGet.call( this, value ); }; descriptor.set = function set( newValue ) { value = onSet.call( this, value, newValue ); return value; }; Object.defineProperty( object, propertyName, descriptor ); } else { throw new Error( "ERR_PROPERTY_NOT_DEFINED" ); } }, "method": function method( object, methodName, onInvoke ) { "use strict"; var method = object[ methodName ]; if ( typeof method === "function" ) { object[ methodName ] = Hooks.fn( method, onInvoke ); } else { throw new Error( "ERR_NOT_A_METHOD" ); } } }; // CXPlayer extends jQuery for its own APIs // so hook jQuery to modify these APIs. window.jQuery = undefined; Hooks.property( window, "jQuery", function( jQuery ) { return jQuery; }, function( u, jQuery ) { // mouseHander() plugin is used to detect MouseEvents. // It will pause video when it detects mouse doesn't move for 30s. jQuery.mouseHander = undefined; Hooks.property( jQuery, "mouseHander", function( p ) { return p; }, function() { return function() { /* Empty */ }; } ); return jQuery; } ); window.addEventListener( "load", function() { var $eryaPlayer = jQuery( "#eryaPlayer" ); // Remove the event listener which pauses the video when // it detects your switching to another tab or application. if ( "onfocus" in window && "onblur" in window ) { window.onfocus = window.onblur = null; } else if ( "onfocusin" in document && "onfocusout" in document ) { document.onfocusin = document.onfocusout = null; } // This loop seems to insure you cann't login multi times // I haven't figure out what it is used for yet /* window.myInterval = function() { // Empty }; */ // Automatically play the next episode $eryaPlayer.bind( "onEnd", function( event, index, config ) { // Wait for the player to synchronize your playback progress $eryaPlayer.bind( "onSendProgressSuccess", function go() { $eryaPlayer.unbind( "onSendProgressSuccess", go ); $eryaPlayer.goPlay( index + 1 ); } ); } ); }, false ); } )();