Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 4663448277352448: Disable history API on YouTube in order to block ads in subsequent videos (Closed)

Created:
Feb. 22, 2014, 5:28 p.m. by Sebastian Noack
Modified:
Feb. 24, 2014, 5:46 p.m.
Visibility:
Public.

Description

Video ads on YouTube are blocked by rewriting the flashvars used to configure the in-video ads. However when you click on another video, the flash player is told via JavaScript which video and which ads to show next, bypassing our flashvars rewrite code. However YouTube can only do that when history.pushState is available. Otherwise it navigates to the URL of the next video, where the player is loaded and the flashvars can be rewritten again. So I have disabled history.pushState for youtube.com, in order to block ads also in subsequent YouTube videos.

Patch Set 1 #

Patch Set 2 : Only disable history.pushState if actually blocking ads #

Total comments: 4

Patch Set 3 : Made pushStateDisabled a local variable #

Patch Set 4 : Addressed comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -11 lines) Patch
M safari/include.youtube.js View 1 2 3 2 chunks +1 line, -11 lines 0 comments Download

Messages

Total messages: 6
Sebastian Noack
Feb. 22, 2014, 5:38 p.m. (2014-02-22 17:38:20 UTC) #1
Felix Dahlke
LGTM. It's a hack, but one that most users shouldn't notice, thanks to graceful degredation. ...
Feb. 24, 2014, 12:30 p.m. (2014-02-24 12:30:25 UTC) #2
Wladimir Palant
This is still a hack but really as safe as it goes, nice solution. http://codereview.adblockplus.org/4663448277352448/diff/5741031244955648/safari/include.youtube.js ...
Feb. 24, 2014, 1:15 p.m. (2014-02-24 13:15:03 UTC) #3
Sebastian Noack
http://codereview.adblockplus.org/4663448277352448/diff/5741031244955648/safari/include.youtube.js File safari/include.youtube.js (right): http://codereview.adblockplus.org/4663448277352448/diff/5741031244955648/safari/include.youtube.js#newcode77 safari/include.youtube.js:77: document.documentElement.appendChild(script); On 2014/02/24 13:15:03, Wladimir Palant wrote: > We ...
Feb. 24, 2014, 2:32 p.m. (2014-02-24 14:32:08 UTC) #4
Wladimir Palant
LGTM
Feb. 24, 2014, 2:52 p.m. (2014-02-24 14:52:47 UTC) #5
Felix Dahlke
Feb. 24, 2014, 5:46 p.m. (2014-02-24 17:46:12 UTC) #6
Even more LGTM!

Powered by Google App Engine
This is Rietveld