aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/background/presenters/TabPresenter.ts4
-rw-r--r--src/background/usecases/NavigateUseCase.ts4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/background/presenters/TabPresenter.ts b/src/background/presenters/TabPresenter.ts
index 5e6e56e..ed88f26 100644
--- a/src/background/presenters/TabPresenter.ts
+++ b/src/background/presenters/TabPresenter.ts
@@ -36,7 +36,9 @@ export default class TabPresenter {
return tabId;
}
- async getByKeyword(keyword: string, excludePinned: boolean = false): Promise<Tab[]> {
+ async getByKeyword(
+ keyword: string, excludePinned: boolean = false,
+ ): Promise<Tab[]> {
let tabs = await browser.tabs.query({ currentWindow: true });
return tabs.filter((t) => {
return t.url && t.url.toLowerCase().includes(keyword.toLowerCase()) ||
diff --git a/src/background/usecases/NavigateUseCase.ts b/src/background/usecases/NavigateUseCase.ts
index ced2a0b..152339a 100644
--- a/src/background/usecases/NavigateUseCase.ts
+++ b/src/background/usecases/NavigateUseCase.ts
@@ -33,9 +33,9 @@ export default class NavigateUseCase {
async openParent(): Promise<void> {
let tab = await this.tabPresenter.getCurrent();
let url = new URL(tab.url!!);
- if (url.hash !== '') {
+ if (url.hash.length > 0) {
url.hash = '';
- } else if (url.search !== '') {
+ } else if (url.search.length > 0) {
url.search = '';
} else {
const basenamePattern = /\/[^/]+$/;