*Add support for redirecting web3 domain proxies

This commit is contained in:
Derrick Hammer 2022-09-08 07:31:24 -04:00
parent 8a0de28d32
commit 48ef0411b3
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 15 additions and 0 deletions

View File

@ -108,6 +108,21 @@ export default class WebEngine {
return { redirectUrl: navRedirect as string };
}
const domainPatterns = {
"eth.link": "eth",
"eth.limo": "eth",
"hns.is": "",
"hns.to": "",
} as { [pattern: string]: string };
for (const pattern of Object.keys(domainPatterns)) {
if (details.url.includes(pattern)) {
return {
redirectUrl: details.url.replace(pattern, domainPatterns[pattern]),
};
}
}
const provider = this.getRequestProvider(details.requestId);
if (provider) {
let urlObj = new URL(details.url);