If a hash is given in the URL, search for it

Makes `https://torrent-paradise.ml/#ubuntu%20iso` automatically open a search for `ubuntu iso`.
pull/29/head
Rebecca Turner 3 years ago committed by GitHub
parent 19224e723c
commit ff197583be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -14,4 +14,11 @@ if (searchbox != null) {
searchTriggered()
}
}
}
}
// If the URL has a hash (e.g. #ubuntu iso), search for it.
if (window.location.hash) {
// `substr(1)` to trim off the leading `#`, `decodeURIComponent` to handle things like `%20` for ` `.
searchbox.value = decodeURIComponent(window.location.hash.substr(1));
searchTriggered();
}

Loading…
Cancel
Save