mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Merge pull request #16007 from Snuffleupagus/getDocument-params-init
Re-factor the parameter parsing/validation in `getDocument`
This commit is contained in:
commit
05d821e680
2 changed files with 213 additions and 230 deletions
10
web/app.js
10
web/app.js
|
@ -932,12 +932,10 @@ const PDFViewerApplication = {
|
|||
) {
|
||||
// The Firefox built-in viewer always calls `setTitleUsingUrl`, before
|
||||
// `initPassiveLoading`, and it never provides an `originalUrl` here.
|
||||
if (args.originalUrl) {
|
||||
this.setTitleUsingUrl(args.originalUrl, /* downloadUrl = */ args.url);
|
||||
delete args.originalUrl;
|
||||
} else {
|
||||
this.setTitleUsingUrl(args.url, /* downloadUrl = */ args.url);
|
||||
}
|
||||
this.setTitleUsingUrl(
|
||||
args.originalUrl || args.url,
|
||||
/* downloadUrl = */ args.url
|
||||
);
|
||||
}
|
||||
// Set the necessary API parameters, using all the available options.
|
||||
const apiParams = AppOptions.getAll(OptionKind.API);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue