From de852785371c2611b032d164079694e8144ee9b2 Mon Sep 17 00:00:00 2001 From: Rob Wu Date: Fri, 24 Jun 2016 00:57:30 +0200 Subject: [PATCH] Move Chromium URL rewrite to top of viewer.js Move the Chromium-specific URL rewriting code to the top of viewer.js (before the PDF.js library) to make sure that the URL is as expected. This ensures that variables that synchronously depends on the URL (e.g. PDFViewerApplication.initialBookmark) are properly set. --- web/viewer.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/web/viewer.js b/web/viewer.js index b17cb10fd..59fbbeff7 100644 --- a/web/viewer.js +++ b/web/viewer.js @@ -18,21 +18,6 @@ var DEFAULT_URL = 'compressed.tracemonkey-pldi-09.pdf'; -//#if PRODUCTION -//var pdfjsWebLibs = { -// pdfjsWebPDFJS: window.pdfjsDistBuildPdf -//}; -// -//(function () { -//#expand __BUNDLE__ -//}).call(pdfjsWebLibs); -//#endif - -//#if FIREFOX || MOZCENTRAL -//// FIXME the l10n.js file in the Firefox extension needs global FirefoxCom. -//window.FirefoxCom = pdfjsWebLibs.pdfjsWebFirefoxCom.FirefoxCom; -//#endif - //#if CHROME //(function rewriteUrlClosure() { // // Run this code outside DOMContentLoaded to make sure that the URL @@ -50,6 +35,21 @@ var DEFAULT_URL = 'compressed.tracemonkey-pldi-09.pdf'; //})(); //#endif +//#if PRODUCTION +//var pdfjsWebLibs = { +// pdfjsWebPDFJS: window.pdfjsDistBuildPdf +//}; +// +//(function () { +//#expand __BUNDLE__ +//}).call(pdfjsWebLibs); +//#endif + +//#if FIREFOX || MOZCENTRAL +//// FIXME the l10n.js file in the Firefox extension needs global FirefoxCom. +//window.FirefoxCom = pdfjsWebLibs.pdfjsWebFirefoxCom.FirefoxCom; +//#endif + function getViewerConfiguration() { return { appContainer: document.body,