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

Side by Side Diff: safari/include.youtube.js

Issue 4868442016448512: Issue 413 - Don't block YouTube annotations on Safari (Closed)
Patch Set: Removed invideo parameter Created May 2, 2014, 10:34 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 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
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17 17
18 (function() { 18 (function() {
19 if (document.domain != "www.youtube.com") 19 if (document.domain != "www.youtube.com")
20 return; 20 return;
21 21
22 function rewriteFlashvars(flashvars) 22 function rewriteFlashvars(flashvars)
23 { 23 {
24 var pairs = flashvars.split("&"); 24 var pairs = flashvars.split("&");
25 for (var i = 0; i < pairs.length; i++) 25 for (var i = 0; i < pairs.length; i++)
26 if (/^((ad|afv|adsense|iv)(_.*)?|(ad3|iv3|st)_module|prerolls|interstitial |infringe|invideo)=/.test(pairs[i])) 26 if (/^((ad|afv|adsense)(_.*)?|(ad3|st)_module|prerolls|interstitial|infrin ge|iv_cta_url)=/.test(pairs[i]))
27 pairs.splice(i--, 1); 27 pairs.splice(i--, 1);
28 return pairs.join("&"); 28 return pairs.join("&");
29 } 29 }
30 30
31 function patchPlayer(player) 31 function patchPlayer(player)
32 { 32 {
33 var newPlayer = player.cloneNode(true); 33 var newPlayer = player.cloneNode(true);
34 var flashvarsChanged = false; 34 var flashvarsChanged = false;
35 35
36 var flashvars = newPlayer.getAttribute("flashvars"); 36 var flashvars = newPlayer.getAttribute("flashvars");
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 { 94 {
95 deferred.forEach(patchPlayer); 95 deferred.forEach(patchPlayer);
96 onBeforeLoadYoutubeVideo = patchPlayer; 96 onBeforeLoadYoutubeVideo = patchPlayer;
97 } 97 }
98 else 98 else
99 document.removeEventListener("beforeload", onBeforeLoad, true); 99 document.removeEventListener("beforeload", onBeforeLoad, true);
100 }); 100 });
101 101
102 document.addEventListener("beforeload", onBeforeLoad, true); 102 document.addEventListener("beforeload", onBeforeLoad, true);
103 })(); 103 })();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld