by kradeelav on 6/14/24, 8:50 PM with 16 comments
by runjake on 6/14/24, 9:51 PM
But here is some sloppy code you could create a basic browser extension and shove in content.js:
function hideVerticalVideos() {
const videos = document.querySelectorAll('video');
videos.forEach(video => {
if (video.videoHeight > video.videoWidth) {
video.style.display = 'none';
}
});
}
// Run hideVerticalVideos() when the page loads
window.addEventListener('load', hideVerticalVideos);
// Run when the DOM updates
const observer = new MutationObserver(hideVerticalVideos);
observer.observe(document.body, { childList: true, subtree: true });
by ryandetzel on 6/14/24, 11:34 PM
by musicale on 6/16/24, 3:32 AM
Safari in particular has never worked, but I've had bad luck with Chrome and Firefox as well.
by gentile on 6/15/24, 6:05 PM
by danjl on 6/16/24, 5:53 PM
by musicale on 6/15/24, 3:59 AM
On a related note, is there a browser that can completely block auto-playing video with a setting that actually works?
I find it depressing that web developers seem willing to do anything to ignore user preferences, especially when intrusive advertising is involved.
by cpach on 6/15/24, 2:34 PM
by ivanjermakov on 6/14/24, 10:47 PM