Limit AppOptions._hasUserOptions to only GENERIC builds

It's completely unused elsewhere, e.g. in the Firefox PDF Viewer.
This commit is contained in:
Jonas Jenwald 2023-02-10 15:37:51 +01:00
parent 903adc8708
commit 6c158da5a8
2 changed files with 5 additions and 9 deletions

View File

@ -268,10 +268,7 @@ const PDFViewerApplication = {
* @private
*/
async _readPreferences() {
if (
typeof PDFJSDev === "undefined" ||
PDFJSDev.test("!PRODUCTION || GENERIC")
) {
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
if (AppOptions.get("disablePreferences")) {
// Give custom implementations of the default viewer a simpler way to
// opt-out of having the `Preferences` override existing `AppOptions`.

View File

@ -404,13 +404,12 @@ class AppOptions {
static remove(name) {
delete userOptions[name];
}
}
/**
* @ignore
*/
static _hasUserOptions() {
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
AppOptions._hasUserOptions = function () {
return Object.keys(userOptions).length > 0;
}
};
}
export { AppOptions, compatibilityParams, OptionKind };