refactor back button

This commit is contained in:
quenousimporte 2023-07-11 09:43:26 +02:00
parent 89cb8937a9
commit cf954e0f47
1 changed files with 6 additions and 2 deletions

View File

@ -1196,6 +1196,10 @@ function initshortcuts()
});
}
function addfakehistory()
{
history.pushState({}, '', '.');
}
function init()
{
loadsettings();
@ -1204,10 +1208,10 @@ function init()
window.onbeforeunload = checksaved;
window.onclick = focuseditor;
history.pushState({}, '', '.');
addfakehistory();
window.onpopstate = function(evt)
{
history.pushState({}, '', '.');
addfakehistory();
if (!searchdialog.hidden)
{
esc(evt);