1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 22:58:07 +02:00

Attempt to migrate the old showPreviousViewOnLoad/disablePageMode preferences to the new viewOnLoad preference

This patch ignores the recently added `disableOpenActionDestination` preference, since the latest PDF.js version found on the "Chrome Web Store" doesn't include it.
This commit is contained in:
Jonas Jenwald 2019-02-02 10:08:45 +01:00
parent 6806248030
commit 4d4c98d1eb
2 changed files with 26 additions and 0 deletions

View file

@ -341,6 +341,8 @@ class ChromePreferences extends BasePreferences {
enableHandToolOnLoad: false,
disableTextLayer: false,
enhanceTextSelection: false,
showPreviousViewOnLoad: true,
disablePageMode: false,
}, this.defaults);
chrome.storage.managed.get(defaultManagedPrefs, function(items) {
@ -370,6 +372,13 @@ class ChromePreferences extends BasePreferences {
delete items.disableTextLayer;
delete items.enhanceTextSelection;
// Migration code for https://github.com/mozilla/pdf.js/pull/10502.
if (!items.showPreviousViewOnLoad && !items.viewOnLoad) {
items.viewOnLoad = 1;
}
delete items.showPreviousViewOnLoad;
delete items.disablePageMode;
getPreferences(items);
});
} else {