// ==UserScript== // @name LinguaLeo sound download // @namespace http://golubev.guru/ // @version 0.2 // @description auto download mp3 from lingualeo dictionary by F7 // @author Yuriy Golubev // @match https://lingualeo.com/* // @grant GM_download // ==/UserScript== (function() { 'use strict'; // Your code here... function doc_keyUp(e) { switch (e.keyCode) { case 118: var url = document.getElementsByClassName("word-sound-link")[0].getAttribute("data-voice-url"); var word = document.getElementsByClassName("word-sound-link")[0].parentElement.parentElement.getElementsByClassName("word-origin")[0].innerText; GM_download(url, word.replace(/ /g, "-") + ".mp3"); break; default: break; } } document.addEventListener('keyup', doc_keyUp, false); })();