Skip to content

Instantly share code, notes, and snippets.

@Ghabry
Created January 10, 2018 00:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ghabry/7a98652d430c023e25342200b735d103 to your computer and use it in GitHub Desktop.
Save Ghabry/7a98652d430c023e25342200b735d103 to your computer and use it in GitHub Desktop.
// ==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