mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-08-02 12:27:21 +02:00
Compare commits
No commits in common. "91175dc67d13addbc0c172858fb87bae8c8212af" and "de2a44a5588604561d2e9ebf7825063a9d6f31b1" have entirely different histories.
91175dc67d
...
de2a44a558
@ -771,9 +771,6 @@ class PDFFindController {
|
||||
}
|
||||
|
||||
#calculateMatch(pageIndex) {
|
||||
if (!this.#state) {
|
||||
return;
|
||||
}
|
||||
const query = this.#query;
|
||||
if (query.length === 0) {
|
||||
return; // Do nothing: the matches should be wiped out already.
|
||||
@ -885,17 +882,12 @@ class PDFFindController {
|
||||
|
||||
let deferred = Promise.resolve();
|
||||
const textOptions = { disableNormalization: true };
|
||||
const pdfDoc = this._pdfDocument;
|
||||
for (let i = 0, ii = this._linkService.pagesCount; i < ii; i++) {
|
||||
const { promise, resolve } = Promise.withResolvers();
|
||||
this._extractTextPromises[i] = promise;
|
||||
|
||||
deferred = deferred.then(async () => {
|
||||
if (pdfDoc !== this._pdfDocument) {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
await pdfDoc
|
||||
deferred = deferred.then(() =>
|
||||
this._pdfDocument
|
||||
.getPage(i + 1)
|
||||
.then(pdfPage => pdfPage.getTextContent(textOptions))
|
||||
.then(
|
||||
@ -928,8 +920,8 @@ class PDFFindController {
|
||||
this._hasDiacritics[i] = false;
|
||||
resolve();
|
||||
}
|
||||
);
|
||||
});
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user