Skip to content

Commit

Permalink
Prevent exceptions in Edge Legacy and IE
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaifroid committed Dec 13, 2020
1 parent 5b15b3b commit 282ef47
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion www/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1654,7 +1654,13 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'settingsStore','abstractFilesys
stateLabel = "Wikipedia search : " + titleSearch;
}
else return;
targetWin.history.pushState(stateObj, stateLabel, urlParameters);
// Edge Legacy and IE cannot push history to another window/tab and produce an exception
// independent navigation is therefore disabled for these browsers
try {
targetWin.history.pushState(stateObj, stateLabel, urlParameters);
} catch (error) {
history.pushState(stateObj, stateLabel, urlParameters);
}
}


Expand Down

0 comments on commit 282ef47

Please sign in to comment.