// ==UserScript== // @name TAB shortcut-key play voice for Duolingo // @namespace TAB shortcut-key play voice for Duolingo // @version 0.7 // @description TAB shortcut-key play voice for Duolingo (タブキーで発音を聞く) // @author meguru // @match https://www.duolingo.com/* // @grant none // @downloadURL none // ==/UserScript== (function () { 'use strict'; function playSound(evt) { const key = { tab: 9, a: 65 } if (evt.keyCode === key.tab) { document.dispatchEvent(new KeyboardEvent("keydown", { key: " ", ctrlKey: true })); evt.preventDefault(); } } document.addEventListener("keydown", playSound, false); })();