title: JS in Safari on Mac window.location issues
body: <p>I have a very basic search box on my website.  It's worked great on Windows in every major browser.  Works fine on iOS in Chrome and Safari.  On Safari, on a Mac specifically (latest Safari/latest Mac), it has an issue.  I had a client report it but I can also reproduce in Browserstack.</p>
  <p>This is the most basic 'take a search term and redirect to a search page' code yet on Mac it just redirects to a bad URL.  What am I missing?</p>
  <p>On Windows, the resulting URL is (according to the backend as far as the URL getting passed):
  <a href="https://dev7.blah.com/search/ergo" rel="nofollow noreferrer">https://dev7.blah.com/search/ergo</a></p>
  <p>On Mac, the resulting URL is:
  <a href="https://dev7.blah.com/" rel="nofollow noreferrer">https://dev7.blah.com/</a>?</p>
  <pre><code>   $(document).on('keyup', '.searchKeyword', function(e){                                
          if(e.keyCode == 13) {
              var url = window.location.protocol + &quot;//&quot; + window.location.hostname;   
              if(url.slice(-1) != &quot;/&quot;) {
                  url = url+&quot;/&quot;;
              }   
              url = url+&quot;search&quot;; 
              var keyword = $(this).val();            
              if(keyword.trim() != '') {
                  url = url+&quot;/&quot;+keyword;
              }            
              location.href = url;
          }
      });
  </code></pre>
  <p>EDIT: I removed jQuery completely and still getting the same result:</p>
  <pre><code>function doSearch(event) {    
      if(event.keyCode == 13) {        
          var url = getURL();         
          var keyword = document.getElementById('searchBox').value;            
          if(keyword.trim() != '') {
              url = url+&quot;search/&quot;+keyword;
          }            
          window.location.href = url;
      }
  }
  </code></pre>