Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This variable will be changed by iOS scripts. | 5 // This variable will be changed by iOS scripts. |
| 6 var distiller_on_ios = false; | 6 var distiller_on_ios = false; |
| 7 | 7 |
| 8 var navigate_on_initial_content_load = false; | |
| 9 | |
| 10 function didNavigateOnInitialContentLoad() { | |
| 11 navigate_on_initial_content_load = true; | |
| 12 } | |
| 13 | |
| 8 function addToPage(html) { | 14 function addToPage(html) { |
| 9 var div = document.createElement('div'); | 15 var div = document.createElement('div'); |
| 10 div.innerHTML = html; | 16 div.innerHTML = html; |
| 11 document.getElementById('content').appendChild(div); | 17 document.getElementById('content').appendChild(div); |
| 12 fillYouTubePlaceholders(); | 18 fillYouTubePlaceholders(); |
| 13 | 19 |
| 14 if (typeof navigate_on_initial_content_load !== 'undefined' && | 20 if (navigate_on_initial_content_load) { |
|
Lei Zhang
2015/08/14 05:44:36
Why isn't |navigate_on_initial_content_load| prope
csaavedra
2015/08/14 08:21:37
As explained earlier, the code injected from Print
| |
| 15 navigate_on_initial_content_load) { | |
| 16 navigate_on_initial_content_load = false; | 21 navigate_on_initial_content_load = false; |
| 17 setTimeout(function() { | 22 setTimeout(function() { |
| 18 window.location = window.location + "#loaded"; | 23 window.location = window.location + "#loaded"; |
| 19 }, 0); | 24 }, 0); |
| 20 } | 25 } |
| 21 } | 26 } |
| 22 | 27 |
| 23 function fillYouTubePlaceholders() { | 28 function fillYouTubePlaceholders() { |
| 24 var placeholders = document.getElementsByClassName('embed-placeholder'); | 29 var placeholders = document.getElementsByClassName('embed-placeholder'); |
| 25 for (var i = 0; i < placeholders.length; i++) { | 30 for (var i = 0; i < placeholders.length; i++) { |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 393 shiftY: shiftY | 398 shiftY: shiftY |
| 394 }; | 399 }; |
| 395 } | 400 } |
| 396 }; | 401 }; |
| 397 }()); | 402 }()); |
| 398 | 403 |
| 399 window.addEventListener('touchstart', pincher.handleTouchStart, false); | 404 window.addEventListener('touchstart', pincher.handleTouchStart, false); |
| 400 window.addEventListener('touchmove', pincher.handleTouchMove, false); | 405 window.addEventListener('touchmove', pincher.handleTouchMove, false); |
| 401 window.addEventListener('touchend', pincher.handleTouchEnd, false); | 406 window.addEventListener('touchend', pincher.handleTouchEnd, false); |
| 402 window.addEventListener('touchcancel', pincher.handleTouchCancel, false); | 407 window.addEventListener('touchcancel', pincher.handleTouchCancel, false); |
| OLD | NEW |