I have a search engine that redirects you to a search page (http://clickette.cf/search) when you type in a search query, showing the results on that new page. The problem is, that if you were to visit that page without a search term, you would get a blank page. Here is an example:
.a {
text-align: center;
}
<div class="a">
<a href="/">
<img src="/images/branding.png" height="64">
</a>
</div>
<script async src="https://cse.google.com/cse.js?cx=05e63c7384c9442b7"></script>
<div class="gcse-searchbox-only" data-resultsUrl="/search">
<div class="a"></div>
</div>
<div class="gcse-searchresults-only"></div>
What I want to do is make it so that I can run a function (in this case, document.location.replace) if there is no referrer, meaning that you just typed in https://clickette.cf/search. How would I detect if there is no referrer?