Tell me more ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

I don't mind the advertisements on the right side or the small banner inside Youtube videos, but the advertisements shown before a video is played are really annoying.

How can I disable those advertisements? I know I can install AdBlock Plus for Firefox, but that also disables all other advertisements which is not fair for webmasters. If that's the only way to get rid of the advertisements, Google seriously did something wrong.

share|improve this question

3 Answers

You can use Youtube options for Google Chrome, under video options in the settings enable "Hide in-video ads and annotations"

Hide the in-video ads

share|improve this answer
Do you know a similar tool for Firefox? Also, does the option "Hide in-video ads and annotations" affect ads played before videos? – Lekensteyn Feb 9 '12 at 15:51
@Lekensteyn Yes that's what the option means; removes ads before videos. No I don't know a similar tool for Firefox. The author used to have a Firefox extension but they removed it. spoi.com/software/yto – phwd Feb 9 '12 at 16:08
Thanks for your pointer, I've created a small script that does exactly what I want without bells and whistles. webapps.stackexchange.com/a/23745/11016 – Lekensteyn Feb 9 '12 at 16:53
up vote 3 down vote accepted

Based on the extension as posted by @phwd, I've created a simple script that is designed to do exactly one thing: remove in-video advertisements.

Simple installation instructions for Firefox

  1. Go to https://addons.mozilla.org/firefox/addon/greasemonkey/ and press the green installation button
  2. After installation of the add-on, restart Firefox
  3. Open http://lekensteyn.nl/files/Remove_in-video_Youtube_adverts.user.js and press the Install button.
  4. Profit!

Other browsers

Instructions for installing this script across various browsers can be found on http://stackapps.com/tags/script/info

Firefox with Noscript

If you're using Firefox and have NoScript installed, you can use the below surrogates. You have to add two settings to about:config, both of type string.

  1. Key: noscript.surrogate.removeVideoAdsYoutube.sources
    Value:

    !@*.youtube.com

  2. Key: noscript.surrogate.removeVideoAdsYoutube.replacement
    Value:

    (function(){try{var o=yt.playerConfig.args,i;for(i in o){if(o.hasOwnProperty(i)&&/^(afv_)?ad/.test(i))delete o[i]}}catch(e){}var a=document.getElementById("movie_player");if(a){var b=a.cloneNode(!0); b.setAttribute("flashvars", a.getAttribute("flashvars").replace(/&(afv_)?ad[^&]+/g,"")); a.parentNode.replaceChild(b,a)}})()

If you want to make your own surrogates, have a look at http://hackademix.net/2011/09/29/script-surrogates-quick-reference/

share|improve this answer
FYI: this broke at some version, the ads appeared back a month ago or so. – Lekensteyn May 9 at 10:08

After installing AdBlock Plus, change the extension settings to allow everything except the Youtube video ads.

share|improve this answer
It would be better if you could expand your answer to state what the video ads are for the filter to enter. What particular text or phrase if need be – Eight Days of Malaise Aug 28 '11 at 5:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.