     commandsToKey[command] = (commandsToKey[command] || []).concat(key)
 
   replacementStrings =
-    version: currentVersion
+    version: Utils.getCurrentVersion()
     title: customTitle || "Help"
     tip: if showCommandNames then "Tip: click command names to yank them to the clipboard." else "&nbsp;"
 


# Show notification on upgrade.
do showUpgradeMessage = ->
  # Avoid showing the upgrade notification when previousVersion is undefined, which is the case for new
  # installs.
  Settings.set "previousVersion", currentVersion  unless Settings.get "previousVersion"
  if Utils.compareVersions(currentVersion, Settings.get "previousVersion" ) == 1
    notificationId = "VimiumUpgradeNotification"
    notification =
      type: "basic"
      iconUrl: chrome.runtime.getURL "icons/vimium.png"
      title: "Vimium Upgrade"
      message: "Vimium has been upgraded to version #{currentVersion}. Click here for more information."
      isClickable: true
    if chrome.notifications?.create?
      chrome.notifications.create notificationId, notification, ->
        unless chrome.runtime.lastError
          Settings.set "previousVersion", currentVersion
          chrome.notifications.onClicked.addListener (id) ->
            if id == notificationId
              chrome.tabs.getSelected null, (tab) ->
                TabOperations.openUrlInNewTab {tab, tabId: tab.id, url: "https://github.com/philc/vimium#release-notes"}
    else
      # We need to wait for the user to accept the "notifications" permission.
      chrome.permissions.onAdded.addListener showUpgradeMessage

# The install date is shown on the logging page.
chrome.runtime.onInstalled.addListener ({reason}) ->

        for file in files
          func tab.id, { file: file, allFrames: contentScripts.all_frames }, checkLastRuntimeError

frameIdsForTab = {}
portsForTab = {}
root.urlForTab = {}
