Merge pull request #18448 from Snuffleupagus/AppOptions-more-browser-params

Include additional data when fetching browser preferences in the PDF Viewer (bug 1908401)
This commit is contained in:
Jonas Jenwald 2024-07-18 14:19:50 +02:00 committed by GitHub
commit 5be66580e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 23 additions and 56 deletions

View file

@ -14,6 +14,7 @@
*/
import { isPdfFile, PDFDataRangeTransport } from "pdfjs-lib";
import { AppOptions } from "./app_options.js";
import { BaseExternalServices } from "./external_services.js";
import { BasePreferences } from "./preferences.js";
import { DEFAULT_SCALE_VALUE } from "./ui_utils.js";
@ -400,32 +401,14 @@ class ExternalServices extends BaseExternalServices {
}
async createL10n() {
const [localeProperties] = await Promise.all([
FirefoxCom.requestAsync("getLocaleProperties", null),
document.l10n.ready,
]);
return new L10n(localeProperties, document.l10n);
await document.l10n.ready;
return new L10n(AppOptions.get("localeProperties"), document.l10n);
}
createScripting() {
return FirefoxScripting;
}
async getNimbusExperimentData() {
if (!PDFJSDev.test("GECKOVIEW")) {
return null;
}
const nimbusData = await FirefoxCom.requestAsync(
"getNimbusExperimentData",
null
);
return nimbusData && JSON.parse(nimbusData);
}
async getGlobalEventNames() {
return FirefoxCom.requestAsync("getGlobalEventNames", null);
}
dispatchGlobalEvent(event) {
FirefoxCom.request("dispatchGlobalEvent", event);
}