Skip to content

Commit d649b85

Browse files
authored
Update subdomain-availability.js
1 parent c324b54 commit d649b85

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

scripts/subdomain-availability.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,22 @@ async function fetchReservedDomains() {
1717
if (!reservedDomains) {
1818
const res1 = await fetch("https://raw.githubusercontent.com/is-a-dev/register/main/util/reserved.json");
1919
if (!res1.ok) throw new Error(`Failed to fetch reserved domains: ${res1.statusText}`);
20+
2021
const res2 = await fetch("https://raw.githubusercontent.com/is-a-dev/register/main/util/internal.json");
2122
if (!res2.ok) throw new Error(`Failed to fetch internal domains: ${res2.statusText}`);
23+
2224
reservedDomains = [...await res1.json(), ...await res2.json()];
2325
searchDomain.disabled = false;
24-
searchDomain.placeholder = "e.g. john";
26+
27+
const params = new URLSearchParams(window.location.search);
28+
const subdomain = params.get("d");
29+
30+
if (subdomain) {
31+
searchDomain.placeholder = `e.g. ${subdomain}`;
32+
} else {
33+
searchDomain.placeholder = "e.g. william";
34+
}
35+
2536
}
2637
} catch (error) {
2738
console.error(error.message);

0 commit comments

Comments
 (0)