diff --git a/packages/extension-base/package.json b/packages/extension-base/package.json index 9359c101..57b50c70 100644 --- a/packages/extension-base/package.json +++ b/packages/extension-base/package.json @@ -36,7 +36,6 @@ "@polkadot/util-crypto": "^13.5.3", "eventemitter3": "^5.0.1", "rxjs": "^7.8.1", - "tldts": "^7.0.8", "tslib": "^2.8.1" }, "devDependencies": { diff --git a/packages/extension-base/src/background/handlers/Tabs.ts b/packages/extension-base/src/background/handlers/Tabs.ts index 7b8e9dc6..dbddf7cd 100644 --- a/packages/extension-base/src/background/handlers/Tabs.ts +++ b/packages/extension-base/src/background/handlers/Tabs.ts @@ -13,7 +13,6 @@ import type { AuthResponse } from './State.js'; import type State from './State.js'; import { combineLatest, type Subscription } from 'rxjs'; -import { parse } from 'tldts'; import { checkIfDenied } from '@polkadot/phishing'; import { keyring } from '@polkadot/ui-keyring'; @@ -216,22 +215,6 @@ export default class Tabs { }); } - private parseUrl (rawUrl: string): string { - let from = 'extension'; - - if (rawUrl) { - try { - const { hostname } = parse(rawUrl); - - from = hostname || ''; // Only use the hostname - } catch { - from = ''; - } - } - - return from; - } - private async redirectIfPhishing (url: string): Promise { const isInDenyList = await checkIfDenied(url); @@ -246,9 +229,7 @@ export default class Tabs { public async handle (id: string, type: TMessageType, request: RequestTypes[TMessageType], url: string, port?: chrome.runtime.Port): Promise { if (type === 'pub(phishing.redirectIfDenied)') { - const parsedUrl = this.parseUrl(url); - - return this.redirectIfPhishing(parsedUrl); + return this.redirectIfPhishing(url); } if (type !== 'pub(authorize.tab)') { diff --git a/packages/extension-base/src/background/handlers/index.ts b/packages/extension-base/src/background/handlers/index.ts index dd3ab33e..8980d479 100644 --- a/packages/extension-base/src/background/handlers/index.ts +++ b/packages/extension-base/src/background/handlers/index.ts @@ -31,7 +31,6 @@ export default function handler ({ id, messag const from = isExtension ? 'extension' : sender?.url || sender?.tab?.url || ''; - const source = `${from}: ${id}: ${message}`; console.log(` [in] ${source}`); // :: ${JSON.stringify(request)}`); diff --git a/yarn.lock b/yarn.lock index beb71fda..3e1c5ed1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1079,7 +1079,6 @@ __metadata: "@polkadot/util-crypto": "npm:^13.5.3" eventemitter3: "npm:^5.0.1" rxjs: "npm:^7.8.1" - tldts: "npm:^7.0.8" tslib: "npm:^2.8.1" languageName: unknown linkType: soft