-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathVocaroo_HTML5.user.js
More file actions
26 lines (22 loc) · 837 Bytes
/
Vocaroo_HTML5.user.js
File metadata and controls
26 lines (22 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// ==UserScript==
// @name Vocaroo HTML5
// @author Tailszefox
// @namespace localhost
// @description Adds an HTML5 player to Vocaroo
// @icon https://vocaroo.com/title.gif
// @include https://vocaroo.com/i/*
// @version 1.0
// @grant none
// ==/UserScript==
var audio = document.createElement("audio");
audio.setAttribute("controls", "controls");
audioLinks = ["idDownloadAsMp3Link", "idDownloadAsOggLink", "idDownloadAsFlacLink", "idDownloadAsWavLink"]
for (var i = 0; i < audioLinks.length; i++)
{
var l = document.querySelector("#" + audioLinks[i]);
var audioUrl = l.attributes["href"].value;
var sourceAudio = document.createElement("source");
sourceAudio.setAttribute("src", audioUrl);
audio.appendChild(sourceAudio);
}
document.querySelector("#idPlayerBox").appendChild(audio);