mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Return early in PDFViewerApplication._parseHashParameters
when the hash is empty
For people running e.g. Firefox with the `pdfBugEnabled` preference set, to allow quick access to debugging tools, this method will obviously run for every opened PDF file. However, in most cases the URL hash is empty and we can thus skip most of the parsing and simply return early instead.
This commit is contained in:
parent
668a29aa45
commit
0f3e87911f
1 changed files with 6 additions and 4 deletions
10
web/app.js
10
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 &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue