Fix history and bookmarks warnings on Android

jh-changes
robsmith11 6 years ago
parent f60961947f
commit 59dd41b479
  1. 6
      src/background/usecases/CompletionsUseCase.ts

@ -52,13 +52,15 @@ export default class CompletionsUseCase {
if (engines.length > 0) { if (engines.length > 0) {
groups.push({ name: 'Search Engines', items: engines }); groups.push({ name: 'Search Engines', items: engines });
} }
} else if (c === 'h') { // browser.history not supported on Android
} else if (c === 'h' && typeof browser.history === "object") {
// eslint-disable-next-line no-await-in-loop // eslint-disable-next-line no-await-in-loop
let histories = await this.queryHistoryItems(name, keywords); let histories = await this.queryHistoryItems(name, keywords);
if (histories.length > 0) { if (histories.length > 0) {
groups.push({ name: 'History', items: histories }); groups.push({ name: 'History', items: histories });
} }
} else if (c === 'b') { // browser.bookmarks not supported on Android
} else if (c === 'b' && typeof browser.bookmarks === "object") {
// eslint-disable-next-line no-await-in-loop // eslint-disable-next-line no-await-in-loop
let bookmarks = await this.queryBookmarkItems(name, keywords); let bookmarks = await this.queryBookmarkItems(name, keywords);
if (bookmarks.length > 0) { if (bookmarks.length > 0) {