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

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

Issue 29356615: Issue 4351 - Check History variable exists (Closed)
Patch Set: Created Oct. 12, 2016, 3:47 p.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 <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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 90
91 runInPageContext(function(badArgumentsRegexSource) 91 runInPageContext(function(badArgumentsRegexSource)
92 { 92 {
93 var badArgumentsRegex = new RegExp(badArgumentsRegexSource); 93 var badArgumentsRegex = new RegExp(badArgumentsRegexSource);
94 94
95 // If history.pushState is available, YouTube uses the history API 95 // If history.pushState is available, YouTube uses the history API
96 // when navigation from one video to another, and tells the flash 96 // when navigation from one video to another, and tells the flash
97 // player with JavaScript which video and which ads to show next, 97 // player with JavaScript which video and which ads to show next,
98 // bypassing our flashvars rewrite code. So we disable 98 // bypassing our flashvars rewrite code. So we disable
99 // history.pushState before YouTube's JavaScript runs. 99 // history.pushState before YouTube's JavaScript runs.
100 History.prototype.pushState = undefined; 100 if (typeof History != "undefined")
Sebastian Noack 2016/10/12 15:51:58 It seems that the History object is supported sinc
Sebastian Noack 2016/10/12 18:03:35 Fair enough, lets give it a try. But please check
101 History.prototype.pushState = undefined;
101 102
102 // The HTML5 player is configured via ytplayer.config.args. We have 103 // The HTML5 player is configured via ytplayer.config.args. We have
103 // to make sure that ad-related arguments are ignored as they are set. 104 // to make sure that ad-related arguments are ignored as they are set.
104 var ytplayer = undefined; 105 var ytplayer = undefined;
105 Object.defineProperty(window, "ytplayer", 106 Object.defineProperty(window, "ytplayer",
106 { 107 {
107 configurable: true, 108 configurable: true,
108 get: function() 109 get: function()
109 { 110 {
110 return ytplayer; 111 return ytplayer;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 config.args = rawConfig.args; 163 config.args = rawConfig.args;
163 } 164 }
164 } 165 }
165 }); 166 });
166 167
167 ytplayer.config = rawYtplayer.config; 168 ytplayer.config = rawYtplayer.config;
168 } 169 }
169 }); 170 });
170 }, badArgumentsRegex.source); 171 }, badArgumentsRegex.source);
171 })(); 172 })();
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