mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
Don't create PDFViewerApplication.pdfHistory
when the browsing history is disabled
Similar to other viewer components, e.g. the `PDFFindBar` and `PDFPresentationMode`, there's no need to create a `PDFHistory`-instance when it's not going to be used.
This commit is contained in:
parent
8a79f13e5a
commit
aa289b17b6
2 changed files with 13 additions and 15 deletions
|
@ -380,15 +380,11 @@ class PDFLinkService {
|
|||
// See PDF reference, table 8.45 - Named action
|
||||
switch (action) {
|
||||
case "GoBack":
|
||||
if (this.pdfHistory) {
|
||||
this.pdfHistory.back();
|
||||
}
|
||||
this.pdfHistory?.back();
|
||||
break;
|
||||
|
||||
case "GoForward":
|
||||
if (this.pdfHistory) {
|
||||
this.pdfHistory.forward();
|
||||
}
|
||||
this.pdfHistory?.forward();
|
||||
break;
|
||||
|
||||
case "NextPage":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue