diff options
| author | mrmr1993 | 2015-06-02 17:19:24 +0100 | 
|---|---|---|
| committer | mrmr1993 | 2015-06-10 17:22:21 +0100 | 
| commit | 73c651465d1395e23daae01b0ae2a3df5b24a789 (patch) | |
| tree | 9927e354026fabadb2da71861a75e05e3e9ff3bf /lib | |
| parent | e92b9db2aeaa09b1855900936252e27e3535f9da (diff) | |
| download | vimium-73c651465d1395e23daae01b0ae2a3df5b24a789.tar.bz2 | |
Guard against chrome being undefined in the HUD iframe
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/find_mode_history.coffee | 7 | 
1 files changed, 5 insertions, 2 deletions
| diff --git a/lib/find_mode_history.coffee b/lib/find_mode_history.coffee index dd21a2b9..ff660bd2 100644 --- a/lib/find_mode_history.coffee +++ b/lib/find_mode_history.coffee @@ -2,13 +2,16 @@  # This implements find-mode query history (using the "findModeRawQueryList" setting) as a list of raw queries,  # most recent first.  FindModeHistory = -  storage: chrome.storage.local +  storage: chrome?.storage.local # Guard against chrome being undefined (in the HUD iframe).    key: "findModeRawQueryList"    max: 50    rawQueryList: null -  isIncognitoMode: chrome.extension.inIncognitoContext    init: -> +    @isIncognitoMode = chrome?.extension.inIncognitoContext + +    return unless @isIncognitoMode? # chrome is undefined in the HUD iframe during tests, so we do nothing. +      unless @rawQueryList        @rawQueryList = [] # Prevent repeated initialization.        @key = "findModeRawQueryListIncognito" if @isIncognitoMode | 
