From a0657e1bab6450095b020fb47b9c09a8ca7b5cdc Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 24 Jan 2021 14:20:17 -0500 Subject: Various firefox fixes (#1306) * Fix for chrome.commands not being present on Firefox's embedded float.html * Fix _getSearchContext mishandling _optionsContextOverride --- ext/mixed/js/hotkey-help-controller.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ext/mixed/js') diff --git a/ext/mixed/js/hotkey-help-controller.js b/ext/mixed/js/hotkey-help-controller.js index 032573c1..8137b50b 100644 --- a/ext/mixed/js/hotkey-help-controller.js +++ b/ext/mixed/js/hotkey-help-controller.js @@ -83,6 +83,11 @@ class HotkeyHelpController { async _setupGlobalCommands(commandMap) { const commands = await new Promise((resolve, reject) => { + if (!(isObject(chrome.commands) && typeof chrome.commands.getAll === 'function')) { + resolve([]); + return; + } + chrome.commands.getAll((result) => { const e = chrome.runtime.lastError; if (e) { -- cgit v1.2.3