File tree 2 files changed +20
-6
lines changed
2 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -301,13 +301,20 @@ const PDFViewerApplication = {
301
301
*/
302
302
async _readPreferences ( ) {
303
303
if (
304
- ( typeof PDFJSDev === "undefined" ||
305
- PDFJSDev . test ( "!PRODUCTION || GENERIC" ) ) &&
306
- AppOptions . get ( "disablePreferences" )
304
+ typeof PDFJSDev === "undefined" ||
305
+ PDFJSDev . test ( "!PRODUCTION || GENERIC" )
307
306
) {
308
- // Give custom implementations of the default viewer a simpler way to
309
- // opt-out of having the `Preferences` override existing `AppOptions`.
310
- return ;
307
+ if ( AppOptions . get ( "disablePreferences" ) ) {
308
+ // Give custom implementations of the default viewer a simpler way to
309
+ // opt-out of having the `Preferences` override existing `AppOptions`.
310
+ return ;
311
+ }
312
+ if ( AppOptions . _hasUserOptions ( ) ) {
313
+ console . warn (
314
+ "_readPreferences: The Preferences may override manually set AppOptions; " +
315
+ 'please use the "disablePreferences"-option in order to prevent that.'
316
+ ) ;
317
+ }
311
318
}
312
319
try {
313
320
AppOptions . setAll ( await this . preferences . getAll ( ) ) ;
Original file line number Diff line number Diff line change @@ -379,6 +379,13 @@ class AppOptions {
379
379
static remove ( name ) {
380
380
delete userOptions [ name ] ;
381
381
}
382
+
383
+ /**
384
+ * @ignore
385
+ */
386
+ static _hasUserOptions ( ) {
387
+ return Object . keys ( userOptions ) . length > 0 ;
388
+ }
382
389
}
383
390
384
391
export { AppOptions , compatibilityParams , OptionKind } ;
You can’t perform that action at this time.
0 commit comments