diff --git a/web/app.js b/web/app.js index 58984c9e3..8c1e20a52 100644 --- a/web/app.js +++ b/web/app.js @@ -239,6 +239,7 @@ const PDFViewerApplication = { }, /** + * Potentially parse special debugging flags in the hash section of the URL. * @private */ async _parseHashParameters() { @@ -249,11 +250,12 @@ const PDFViewerApplication = { ) { return undefined; } - const waitOn = []; - - // Special debugging flags in the hash section of the URL. const hash = document.location.hash.substring(1); - const hashParams = parseQueryString(hash); + if (!hash) { + return undefined; + } + const hashParams = parseQueryString(hash), + waitOn = []; if ( "disableworker" in hashParams &&