* reverts 824cda7e88

* chore: added tldts

* chore: remove tldts
This commit is contained in:
Arjun Porwal 2025-07-08 22:10:33 +05:30 committed by GitHub
parent f30e960a0a
commit a6b822fe22
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 1 additions and 23 deletions

View File

@ -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": {

View File

@ -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 || '<unknown>'; // Only use the hostname
} catch {
from = '<unknown>';
}
}
return from;
}
private async redirectIfPhishing (url: string): Promise<boolean> {
const isInDenyList = await checkIfDenied(url);
@ -246,9 +229,7 @@ export default class Tabs {
public async handle<TMessageType extends MessageTypes> (id: string, type: TMessageType, request: RequestTypes[TMessageType], url: string, port?: chrome.runtime.Port): Promise<ResponseTypes[keyof ResponseTypes]> {
if (type === 'pub(phishing.redirectIfDenied)') {
const parsedUrl = this.parseUrl(url);
return this.redirectIfPhishing(parsedUrl);
return this.redirectIfPhishing(url);
}
if (type !== 'pub(authorize.tab)') {

View File

@ -31,7 +31,6 @@ export default function handler<TMessageType extends MessageTypes> ({ id, messag
const from = isExtension
? 'extension'
: sender?.url || sender?.tab?.url || '<unknown>';
const source = `${from}: ${id}: ${message}`;
console.log(` [in] ${source}`); // :: ${JSON.stringify(request)}`);

View File

@ -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