*Only add to navigation queue right before dns lookup
This commit is contained in:
parent
d485116f89
commit
f1cba065cb
|
@ -221,15 +221,6 @@ export default class WebEngine {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let resolveRequest: any, rejectRequest: any;
|
|
||||||
|
|
||||||
let promise = new Promise((resolve, reject) => {
|
|
||||||
resolveRequest = resolve;
|
|
||||||
rejectRequest = reject;
|
|
||||||
});
|
|
||||||
|
|
||||||
this.navigations.set(this.getNavigationId(details), promise);
|
|
||||||
|
|
||||||
let queriedUrl = originalUrl.searchParams.get("q") as string;
|
let queriedUrl = originalUrl.searchParams.get("q") as string;
|
||||||
let queriedHost = queriedUrl;
|
let queriedHost = queriedUrl;
|
||||||
try {
|
try {
|
||||||
|
@ -238,21 +229,27 @@ export default class WebEngine {
|
||||||
} catch {}
|
} catch {}
|
||||||
|
|
||||||
if (tldEnum.list.includes(getTld(queriedHost))) {
|
if (tldEnum.list.includes(getTld(queriedHost))) {
|
||||||
resolveRequest();
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isIp(queriedHost)) {
|
if (isIp(queriedHost)) {
|
||||||
resolveRequest();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (/[\s_]/.test(queriedHost)) {
|
if (/[\s_]/.test(queriedHost)) {
|
||||||
resolveRequest();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let dns;
|
let dns;
|
||||||
|
|
||||||
|
let resolveRequest: any, rejectRequest: any;
|
||||||
|
|
||||||
|
let promise = new Promise((resolve, reject) => {
|
||||||
|
resolveRequest = resolve;
|
||||||
|
rejectRequest = reject;
|
||||||
|
});
|
||||||
|
|
||||||
|
this.navigations.set(this.getNavigationId(details), promise);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
dns = await resolve(queriedHost, {});
|
dns = await resolve(queriedHost, {});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Reference in New Issue