Created
January 10, 2018 00:41
-
-
Save Ghabry/7a98652d430c023e25342200b735d103 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name HTML5 Audio for learnrussian.rt.com | |
// @namespace Replaces flash audio on learnrussian.rt.com with HTML5 audio | |
// @include http://learnrussian.rt.com/* | |
// @include https://learnrussian.rt.com/* | |
// ==/UserScript== | |
document.querySelectorAll("div[audio]").forEach(function(x) { | |
var audio = document.createElement("audio"); | |
audio.setAttribute("controls", ""); | |
var src = document.createElement("source"); | |
src.setAttribute("src", x.getAttribute("audio")); | |
audio.appendChild(src); | |
x.className = ""; | |
x.appendChild(audio); | |
}); | |
document.querySelectorAll(".plpau").forEach(function(x) { | |
x.remove(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment