Skip to content

Instantly share code, notes, and snippets.

@NeutralKaon
Last active May 16, 2021 15:22
Show Gist options
  • Save NeutralKaon/74348d3534839809f7104da31fe28be0 to your computer and use it in GitHub Desktop.
Save NeutralKaon/74348d3534839809f7104da31fe28be0 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name ISMRM Video Fixer
// @namespace ismrm-video-fixer
// @version 8
// @description Removes the attribute controls=false of the video tag in pathable.com for ISMRM's conference in 2021, permitting the user to do useful things, e.g. speed them up.
// @author [email protected]
// @include https://*.pathable.com/*
// @run-at document-idle
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// @grant GM_addStyle
// ==/UserScript==
//NB: This is only tested in Firefox.
var observer = new MutationObserver(resetTimer);
var timer = setTimeout(action, 2000, observer); // wait for the page to stay "still" for 2 seconds
observer.observe(document, {childList: true, subtree: true});
function resetTimer(changes, observer) {
clearTimeout(timer);
timer = setTimeout(action, 2000, observer);
}
function action(o) {
o.disconnect();
document.body.innerHTML= document.body.innerHTML.replace(/controls=\"\" controlslist=\"nodownload\"/g,"controls=\"true\" ");
console.log("Full control enabled")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment