Skip to content

Instantly share code, notes, and snippets.

@franciscocorrales
Last active December 12, 2019 20:38
Show Gist options
  • Save franciscocorrales/2ba2939aeec5141d23c03f37c7898bcb to your computer and use it in GitHub Desktop.
Save franciscocorrales/2ba2939aeec5141d23c03f37c7898bcb to your computer and use it in GitHub Desktop.
audible
/**
*/
(function () {
function changeSpeed(speed) {
$($("input[name=speedvalue]")[0]).val(speed);
$("input[name=speedvalue]")[0].click();
}
function createMarkup() {
var elementExists = document.getElementById("fran-extention-main");
if (elementExists) return;
$("body").prepend("<div id='fran-extention-main'>FranciscoPlaceholder</div>");
}
function showPercentage() {
var progressbar = document.querySelector("div[role=progressbar]");
if (!progressbar) { return; }
var percentage = progressbar.getAttribute("aria-valuenow");
console.log("Percentage completed: " + percentage + "%");
}
async function main() {
createMarkup()
showPercentage();
}
main();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment