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

Delta Between Two Patch Sets: safari/include.youtube.js

Issue 29347034: Issue 1727 - Prevent circumvention via WebSocket (Closed)
Left Patch Set: Go with simpler toString fix Created Aug. 10, 2016, 10:17 a.m.
Right Patch Set: Don't hardcode connection state values Created Aug. 10, 2016, 4:25 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « lib/requestBlocker.js ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 if (flashvarsChanged) 85 if (flashvarsChanged)
86 player.parentNode.replaceChild(newPlayer, player); 86 player.parentNode.replaceChild(newPlayer, player);
87 } 87 }
88 88
89 document.addEventListener("beforeload", function(event) 89 document.addEventListener("beforeload", function(event)
90 { 90 {
91 if ((event.target.localName == "object" || event.target.localName == "embed" ) && /:\/\/[^\/]*\.ytimg\.com\//.test(event.url)) 91 if ((event.target.localName == "object" || event.target.localName == "embed" ) && /:\/\/[^\/]*\.ytimg\.com\//.test(event.url))
92 patchPlayer(event.target); 92 patchPlayer(event.target);
93 }, true); 93 }, true);
94 94
95 runInPage(function(badArgumentsRegex) 95 runInPage(function(badArgumentsRegexSource)
96 { 96 {
97 var badArgumentsRegex = new RegExp(badArgumentsRegexSource);
98
97 // If history.pushState is available, YouTube uses the history API 99 // If history.pushState is available, YouTube uses the history API
98 // when navigation from one video to another, and tells the flash 100 // when navigation from one video to another, and tells the flash
99 // player with JavaScript which video and which ads to show next, 101 // player with JavaScript which video and which ads to show next,
100 // bypassing our flashvars rewrite code. So we disable 102 // bypassing our flashvars rewrite code. So we disable
101 // history.pushState before YouTube's JavaScript runs. 103 // history.pushState before YouTube's JavaScript runs.
102 History.prototype.pushState = undefined; 104 History.prototype.pushState = undefined;
103 105
104 // The HTML5 player is configured via ytplayer.config.args. We have 106 // The HTML5 player is configured via ytplayer.config.args. We have
105 // to make sure that ad-related arguments are ignored as they are set. 107 // to make sure that ad-related arguments are ignored as they are set.
106 var ytplayer = undefined; 108 var ytplayer = undefined;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 }); 164 });
163 165
164 config.args = rawConfig.args; 166 config.args = rawConfig.args;
165 } 167 }
166 } 168 }
167 }); 169 });
168 170
169 ytplayer.config = rawYtplayer.config; 171 ytplayer.config = rawYtplayer.config;
170 } 172 }
171 }); 173 });
172 }, badArgumentsRegex); 174 }, badArgumentsRegex.source);
173 })(); 175 })();
LEFTRIGHT

Powered by Google App Engine
This is Rietveld