diff --git a/extensions/chromium/options/migration.js b/extensions/chromium/options/migration.js index 0ecaf2d96e4e4..ca547850c4214 100644 --- a/extensions/chromium/options/migration.js +++ b/extensions/chromium/options/migration.js @@ -78,6 +78,9 @@ limitations under the License. storageSync.get([ 'enableHandToolOnLoad', 'cursorToolOnLoad', + 'disableTextLayer', + 'enhanceTextSelection', + 'textLayerMode', ], function(items) { // Migration code for https://github.com/mozilla/pdf.js/pull/7635. if (typeof items.enableHandToolOnLoad === 'boolean') { @@ -93,6 +96,23 @@ limitations under the License. storageSync.remove('enableHandToolOnLoad'); } } + // Migration code for https://github.com/mozilla/pdf.js/pull/9479. + if (typeof items.disableTextLayer === 'boolean') { + var textLayerMode = items.disableTextLayer ? 0 : + items.enhanceTextSelection ? 2 : 1; + if (textLayerMode !== 1) { + // Overwrite if computed textLayerMode is not the default value (1). + storageSync.set({ + textLayerMode: textLayerMode, + }, function() { + if (!chrome.runtime.lastError) { + storageSync.remove(['disableTextLayer', 'enhanceTextSelection']); + } + }); + } else { + storageSync.remove(['disableTextLayer', 'enhanceTextSelection']); + } + } }); } })(); diff --git a/extensions/chromium/options/options.html b/extensions/chromium/options/options.html index 6a00062e123cb..5b856920295d2 100644 --- a/extensions/chromium/options/options.html +++ b/extensions/chromium/options/options.html @@ -92,6 +92,19 @@ + +