diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-08-22 19:44:31 -0400 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-08-26 21:58:03 -0400 |
commit | a39a1fa9e4700d1189dfc5073b5fcb2557965671 (patch) | |
tree | a803e03e64285d3c2b1c6d4c0e4ee87eee2cb266 /ext/bg/js/settings.js | |
parent | 8ebac935e8c0ee167514d5726b1e2e16921e4957 (diff) |
Add support for Edge browser
Diffstat (limited to 'ext/bg/js/settings.js')
-rw-r--r-- | ext/bg/js/settings.js | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/ext/bg/js/settings.js b/ext/bg/js/settings.js index 75082f3e..e542118c 100644 --- a/ext/bg/js/settings.js +++ b/ext/bg/js/settings.js @@ -116,7 +116,7 @@ async function formMainDictionaryOptionsPopulate(options) { select.append($('<option class="text-muted" value="">Not selected</option>')); let mainDictionary = ''; - for (const dictRow of await utilDatabaseSummarize()) { + for (const dictRow of toIterable(await utilDatabaseSummarize())) { if (dictRow.sequenced) { select.append($(`<option value="${dictRow.title}">${dictRow.title}</option>`)); if (dictRow.title === options.general.mainDictionary) { @@ -314,12 +314,12 @@ async function dictionaryGroupsPopulate(options) { const dictGroups = $('#dict-groups').empty(); const dictWarning = $('#dict-warning').hide(); - const dictRows = await utilDatabaseSummarize(); + const dictRows = toIterable(await utilDatabaseSummarize()); if (dictRows.length === 0) { dictWarning.show(); } - for (const dictRow of dictRowsSort(dictRows, options)) { + for (const dictRow of toIterable(dictRowsSort(dictRows, options))) { const dictOptions = options.dictionaries[dictRow.title] || { enabled: false, priority: 0, @@ -581,20 +581,19 @@ async function onAnkiFieldTemplatesReset(e) { */ async function getBrowser() { - if (typeof chrome !== "undefined") { - if (typeof browser !== "undefined") { - try { - const info = await browser.runtime.getBrowserInfo(); - if (info.name === "Fennec") { - return "firefox-mobile"; - } - } catch (e) { } - return "firefox"; - } else { - return "chrome"; - } + if (EXTENSION_IS_BROWSER_EDGE) { + return 'edge'; + } + if (typeof browser !== 'undefined') { + try { + const info = await browser.runtime.getBrowserInfo(); + if (info.name === 'Fennec') { + return 'firefox-mobile'; + } + } catch (e) { } + return 'firefox'; } else { - return "edge"; + return 'chrome'; } } |