Skip to content

Commit

Permalink
Manually set page title for page history
Browse files Browse the repository at this point in the history
...because apparently browsers ignore the title argument for some reason

see: whatwg/html#2174
  • Loading branch information
allejo committed Mar 14, 2019
1 parent c3efc48 commit 88eeba5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion assets/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@
const searchForm = document.getElementById('search-field');

function pushHistory(query) {
history.pushState({}, 'Search - ' + query + ' - BZFlag', '/search/' + ((query.length)?'?query=' + encodeURIComponent(query):''));
const title = 'Search - ' + query + ' - BZFlag';

history.pushState({}, title, '/search/' + ((query.length) ? '?query=' + encodeURIComponent(query) : ''));
document.title = title;
}

let pushHistoryTimeout;
Expand Down

0 comments on commit 88eeba5

Please sign in to comment.