mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-17 02:38:29 +00:00
feat: input prefill with location hash
This commit is contained in:
parent
60743cdcdf
commit
d5465699e8
@ -607,10 +607,24 @@ window.onload = () => {
|
||||
detectColorScheme();
|
||||
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);
|
||||
|
||||
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) => {
|
||||
button();
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user