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

Unified Diff: safari/include.youtube.js

Issue 6304200141045760: Fix issue with comments and thumbnails not loading on YouTube in Safari (Closed)
Patch Set: Created Feb. 28, 2014, 9:38 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: safari/include.youtube.js
===================================================================
--- a/safari/include.youtube.js
+++ b/safari/include.youtube.js
@@ -67,7 +67,12 @@
// player with JavaScript which video and which ads to show next,
// bypassing our flashvars rewrite code. So we disable
// history.pushState on pages with YouTube's flash player.
- document.location.href = "javascript:void(history.pushState = undefined);";
+ var script = document.createElement("script");
+ script.type = "application/javascript";
+ script.id = "__disablePushState";
+ script.textContent = "history.pushState = undefined;" +
+ "document.documentElement.removeChild(document.getElementById('__disablePushState'));";
Sebastian Noack 2014/02/28 21:54:22 In the previous review Wladimir suggested that we
Wladimir Palant 2014/03/03 07:21:13 Why have the script remove itself? Using |script.a
Sebastian Noack 2014/03/05 11:24:01 Done.
+ document.documentElement.appendChild(script);
}
var deferred = [];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld