*Add support for redirecting web3 domain proxies
This commit is contained in:
parent
8a0de28d32
commit
48ef0411b3
|
@ -108,6 +108,21 @@ export default class WebEngine {
|
||||||
return { redirectUrl: navRedirect as string };
|
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);
|
const provider = this.getRequestProvider(details.requestId);
|
||||||
if (provider) {
|
if (provider) {
|
||||||
let urlObj = new URL(details.url);
|
let urlObj = new URL(details.url);
|
||||||
|
|
Reference in New Issue