Skip to content

Instantly share code, notes, and snippets.

@lylejantzi3rd
Last active February 12, 2025 14:37
Show Gist options
  • Save lylejantzi3rd/7a13b2526a4d99c44ab80105d1be4dcc to your computer and use it in GitHub Desktop.
Save lylejantzi3rd/7a13b2526a4d99c44ab80105d1be4dcc to your computer and use it in GitHub Desktop.
Show video controls for Instagram videos
function mutateInstagramVideo(node) {
node.querySelectorAll('video').forEach(video => {
video.setAttribute('controls', '')
video.nextElementSibling.remove()
})
}
mutateInstagramVideo(document)
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
mutation.addedNodes.forEach(function(node) {
mutateInstagramVideo(node)
})
})
})
observer.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