Created
November 6, 2023 00:38
-
-
Save dag10/6d72019891ab120f351fc1023e51cbba to your computer and use it in GitHub Desktop.
Bookmarklet to show video controls on a web page
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
//bookmarklet_title: Show Video Controls | |
//bookmarklet_about: Drew Gottlieb | |
document.querySelectorAll('video').forEach(video => video.controls = true); | |
new MutationObserver(mutations => { | |
mutations.forEach(mutation => { | |
mutation.addedNodes.forEach(node => { | |
if (node.tagName === 'VIDEO') node.controls = true; | |
}); | |
}); | |
}).observe(document.body, { childList: true, subtree: true }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment