Google-chrome – Stop a site automatically refreshing and playing video

google-chrome

theage.com.au is a news site that loves to reload the page that I'm reading, which annoys the hell out of me. It also automatically starts playing any video on the page as soon as I start scrolling down. Is there any way to stop it from doing both of those things, preferably in Chrome (but Firefox would be interesting, too). Perhaps some extension or something? Ideally I'd like to disable it only for that one domain, because some sites do use auto-refresh for legitimate (non-annoying) purposes.

Best Answer

2016-04 Update

There's a new extension that was published since my original answer, called "Disable HTML5 Autoplay". It seems to work well. The author is responsive and development is active. As per the name, it is for HTML5 video elements, not Flash objects. You can get it here: https://chrome.google.com/webstore/detail/disable-html5-autoplay/efdhoaajjjgckpbkoglidkeendpkolai

As for videos powered by Adobe's Flash plugin, it appears that Chrome by default now attempts to detect whether a Flash object is "important" to the page and disables it if not, so you may find that sufficient. You can also set it to prohibit ANY Flash object from running automatically. Personally, I suggest doing this (or even removing the plugin if you do not depend upon it), as it has been a frequent source of major security vulnerabilities for years. You can do this in Chrome at: Menu > settings > advanced settings (link at the bottom) > Privacy header, Content settings button > Plugins header, "Let me choose when to run plugin content" option. You can also manage exceptions here, which would be pages on which plugins are automatically run.

In addition, I should point out that the auto-refresh blocking workaround in the original answer below was adapted from an answer to this question: https://stackoverflow.com/questions/18273767/how-can-i-block-page-autorefresh-in-google-chrome - I'm not aware of any new solutions at this time.

Original Answer

Unfortunately, I have researched for ways to do these things in Chrome, and found nothing that will work well, but I have a partial workaround here.

The best you can do to prevent refreshes is to use a bookmarklet or a user script extension like Tampermonkey to add the following Javascript to the domain in question:

window.onbeforeunload = function(){ return 'Disabled Auto-Refresh';};

If you want it as a bookmarklet, simply add "javascript:" to the front and make that the target of a bookmark. Click it when you're on the page you want to prevent from refreshing.

This will cause you to get the "Do you want to navigate away from this page?" popup when the site tries to refresh, which is annoying (thanks, Google), but at least you can tell it "no". It simply isn't possible to do this correctly in Chrome due to its limited extension API.

Similarly, there appears to be no good way to prevent HTML5 videos from playing automatically aside from blocking them outright. The closest I have seen anything come is this: https://chrome.google.com/webstore/detail/stop-youtube-html5-autopl/ajkibmginjljbmmpgnipfbcbmkcodaap that tries to pause videos, but the author admits that it doesn't have universal compatibility, and the reviews mention that it doesn't have a whitelist. I don't know whether it is once again Chrome's API limitations that are preventing us from doing what we want or just that nobody has made an appropriate extension.

Related Question