aboutsummaryrefslogtreecommitdiff
path: root/src/background/usecases
diff options
context:
space:
mode:
Diffstat (limited to 'src/background/usecases')
-rw-r--r--src/background/usecases/CompletionsUseCase.ts6
-rw-r--r--src/background/usecases/LinkUseCase.ts7
2 files changed, 8 insertions, 5 deletions
diff --git a/src/background/usecases/CompletionsUseCase.ts b/src/background/usecases/CompletionsUseCase.ts
index ae1ceed..7f6322e 100644
--- a/src/background/usecases/CompletionsUseCase.ts
+++ b/src/background/usecases/CompletionsUseCase.ts
@@ -52,13 +52,15 @@ export default class CompletionsUseCase {
if (engines.length > 0) {
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
let histories = await this.queryHistoryItems(name, keywords);
if (histories.length > 0) {
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
let bookmarks = await this.queryBookmarkItems(name, keywords);
if (bookmarks.length > 0) {
diff --git a/src/background/usecases/LinkUseCase.ts b/src/background/usecases/LinkUseCase.ts
index 2f4df7b..21cf0e7 100644
--- a/src/background/usecases/LinkUseCase.ts
+++ b/src/background/usecases/LinkUseCase.ts
@@ -12,8 +12,9 @@ export default class LinkUseCase {
}
openNewTab(url: string, openerId: number, background: boolean): Promise<any> {
- return this.tabPresenter.create(url, {
- openerTabId: openerId, active: !background
- });
+ // openerTabId not supported on Android
+ let properties = typeof browser.tabs.Tab === "object" ?
+ { openerTabId: openerId, active: !background } : { active: !background };
+ return this.tabPresenter.create(url, properties);
}
}