您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
keybindings for coursera
当前为
// ==UserScript== // @name coursera helper // @namespace http://andreabisognin.it // @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js // @version 0.31 // @description keybindings for coursera // @match https://class.coursera.org/*/lecture/* // @copyright 2014+, Andrea Bisognin // ==/UserScript== this.$ = this.jQuery = jQuery.noConflict(true); $(document).ready(function(){ setTimeout(foo, 10000); }); function foo(){ var Captions = false; var video = unsafeWindow.$("iframe").contents().find("video")[0]; console.log("element is "+video); jQuery(document).keydown(function(e){ if(e.keyCode == 84) { unsafeWindow.$("iframe").contents().find("button[title='Fullscreen']")[0].click(); } if (e.keyCode == 83) { if (Captions){ unsafeWindow.$("iframe").contents().find("input[id='mep_0_captions_none']")[0].click(); unsafeWindow.$("iframe").contents().find("input[id='mep_0_captions_none']")[0].click(); Captions = false; } else { unsafeWindow.$("iframe").contents().find("input[id='mep_0_captions_en']")[0].click(); unsafeWindow.$("iframe").contents().find("input[id='mep_0_captions_en']")[0].click(); Captions = true; } } }); }