mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-18 11:18:28 +00:00
feat: input prefill with location hash
This commit is contained in:
parent
60743cdcdf
commit
d5465699e8
@ -607,10 +607,24 @@ window.onload = () => {
|
|||||||
detectColorScheme();
|
detectColorScheme();
|
||||||
popup("migration", 1);
|
popup("migration", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (window.location.hash) {
|
||||||
|
const input = window.location.hash.slice(1);
|
||||||
|
eid("url-input-area").value = input;
|
||||||
|
button()
|
||||||
|
}
|
||||||
|
|
||||||
window.history.replaceState(null, '', window.location.pathname);
|
window.history.replaceState(null, '', window.location.pathname);
|
||||||
|
|
||||||
notificationCheck();
|
notificationCheck();
|
||||||
}
|
}
|
||||||
|
window.onhashchange = () => {
|
||||||
|
if (window.location.hash) {
|
||||||
|
const input = window.location.hash.slice(1);
|
||||||
|
eid("url-input-area").value = input;
|
||||||
|
button()
|
||||||
|
}
|
||||||
|
}
|
||||||
eid("url-input-area").addEventListener("keydown", (e) => {
|
eid("url-input-area").addEventListener("keydown", (e) => {
|
||||||
button();
|
button();
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user