mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
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:
commit
5be66580e6
4 changed files with 23 additions and 56 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue