Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Unified Diff: components/dom_distiller/core/javascript/dom_distiller_viewer.js

Issue 1920563002: Only trigger navigation in distiller if in print preview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/dom_distiller/core/javascript/dom_distiller_viewer.js
diff --git a/components/dom_distiller/core/javascript/dom_distiller_viewer.js b/components/dom_distiller/core/javascript/dom_distiller_viewer.js
index 5baef4c077b01e799ed52389fda294a596d17fb9..ef2175edfdef3d5305191833ac0b8cabd0de85cf 100644
--- a/components/dom_distiller/core/javascript/dom_distiller_viewer.js
+++ b/components/dom_distiller/core/javascript/dom_distiller_viewer.js
@@ -43,7 +43,8 @@ function showLoadingIndicator(isLastPage) {
// This function will be one of the last things to occur when a page is
// loaded. This is temporarily used to signal print preview to generate
// a PDF.
- if (isLastPage) {
+ if (isLastPage && typeof is_print_preview_distiller !== 'undefined'
Bernhard Bauer 2016/04/25 15:36:38 If you declare this at the global level and initia
mdjones 2016/04/25 16:33:13 Updated var name. Unfortunately I can't pre-define
Bernhard Bauer 2016/04/25 17:30:31 But that's fine, because you'll have declared the
mdjones 2016/04/25 18:24:08 Yes, the whole file is parsed after the JavaScript
Bernhard Bauer 2016/04/28 16:24:04 That does not seem like the right solution. From t
+ && is_print_preview_distiller) {
setTimeout(function() {
window.location = window.location + "#loaded";
}, 0);

Powered by Google App Engine
This is Rietveld 408576698