mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Merge pull request #18484 from calixteman/bug1909310
Add a pref to know if the alt-text must be automatically generated (bug 1909310)
This commit is contained in:
commit
33493301b3
4 changed files with 21 additions and 12 deletions
20
web/app.js
20
web/app.js
|
@ -205,10 +205,10 @@ const PDFViewerApplication = {
|
|||
if (mode) {
|
||||
document.documentElement.classList.add(mode);
|
||||
}
|
||||
} else {
|
||||
} else if (AppOptions.get("enableAltText")) {
|
||||
// We want to load the image-to-text AI engine as soon as possible.
|
||||
this.mlManager = new MLManager({
|
||||
enableAltText: AppOptions.get("enableAltText"),
|
||||
enableGuessAltText: AppOptions.get("enableGuessAltText"),
|
||||
altTextLearnMoreUrl: AppOptions.get("altTextLearnMoreUrl"),
|
||||
});
|
||||
}
|
||||
|
@ -376,14 +376,14 @@ const PDFViewerApplication = {
|
|||
|
||||
let eventBus;
|
||||
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) {
|
||||
eventBus =
|
||||
AppOptions.eventBus =
|
||||
this.mlManager.eventBus =
|
||||
new FirefoxEventBus(
|
||||
AppOptions.get("allowedGlobalEvents"),
|
||||
externalServices,
|
||||
AppOptions.get("isInAutomation")
|
||||
);
|
||||
eventBus = AppOptions.eventBus = new FirefoxEventBus(
|
||||
AppOptions.get("allowedGlobalEvents"),
|
||||
externalServices,
|
||||
AppOptions.get("isInAutomation")
|
||||
);
|
||||
if (this.mlManager) {
|
||||
this.mlManager.eventBus = eventBus;
|
||||
}
|
||||
} else {
|
||||
eventBus = new EventBus();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue