Last active
May 16, 2021 15:22
-
-
Save NeutralKaon/74348d3534839809f7104da31fe28be0 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 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