diff options
Diffstat (limited to 'background_page.html')
| -rw-r--r-- | background_page.html | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/background_page.html b/background_page.html index 87b3c9ad..d98967b4 100644 --- a/background_page.html +++ b/background_page.html @@ -686,6 +686,21 @@ if (localStorage["keyMappings"]) parseCustomKeyMappings(localStorage["keyMappings"]); + // In version 1.22, we changed the mapping for "d" and "u" to be scroll page down/up instead of close + // and restore tab. For existing users, we want to preserve existing behavior for them by adding some + // custom key mappings on their behalf. + if (localStorage.previousVersion == "1.21") { + var customKeyMappings = localStorage["keyMappings"] || ""; + if ((keyToCommandRegistry["d"] || {}).command == "scrollPageDown") + customKeyMappings += "\nmap d removeTab"; + if ((keyToCommandRegistry["u"] || {}).command == "scrollPageUp") + customKeyMappings += "\nmap u restoreTab"; + if (customKeyMappings != "") { + localStorage["keyMappings"] = customKeyMappings; + parseCustomKeyMappings(customKeyMappings); + } + } + populateValidFirstKeys(); populateSingleKeyCommands(); if (shouldShowUpgradeMessage()) |
