您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Control Video forward/backward for Photo Station 6. Backword hotkey: "[", Forward hotkey: "]"
// ==UserScript== // @name Photo Station 6 影片快轉 // @namespace http://tampermonkey.net/ // @version 0.3 // @description Control Video forward/backward for Photo Station 6. Backword hotkey: "[", Forward hotkey: "]" // @author You // @match http://twmedia.coreop.net/photo/ // @icon https://www.google.com/s2/favicons?sz=64&domain=coreop.net // @grant none // ==/UserScript== (function() { 'use strict'; const SECONDS = 5; document.addEventListener('keydown', (event) => { console.log(event.key) const extMain = window.Main; if (!extMain) { console.log('extJs main not found.'); return; } if (event.key === '[') { const position = extMain.getScope("PhotoStation.VideoPlayer").player.getPosition(); extMain.getScope("PhotoStation.VideoPlayer").player.seek(position - SECONDS); } else if (event.key === ']') { const position = extMain.getScope("PhotoStation.VideoPlayer").player.getPosition(); extMain.getScope("PhotoStation.VideoPlayer").player.seek(position + SECONDS); } }); })();