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

View File

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