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.
This commit is contained in:
Rob Wu 2016-06-24 00:57:30 +02:00
parent 64a409b539
commit de85278537

View File

@ -18,21 +18,6 @@
var DEFAULT_URL = 'compressed.tracemonkey-pldi-09.pdf'; 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 //#if CHROME
//(function rewriteUrlClosure() { //(function rewriteUrlClosure() {
// // Run this code outside DOMContentLoaded to make sure that the URL // // Run this code outside DOMContentLoaded to make sure that the URL
@ -50,6 +35,21 @@ var DEFAULT_URL = 'compressed.tracemonkey-pldi-09.pdf';
//})(); //})();
//#endif //#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() { function getViewerConfiguration() {
return { return {
appContainer: document.body, appContainer: document.body,