aboutsummaryrefslogtreecommitdiffhomepage
path: root/js/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/main.js')
-rw-r--r--js/main.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/js/main.js b/js/main.js
index c0b7d11..cb23a7f 100644
--- a/js/main.js
+++ b/js/main.js
@@ -21,7 +21,15 @@ var libraryType = "shows"; // Sets whether the library is a show or a movie / ot
$(document).ready(() => {
// Check if there is a page refresh, if so we want to push the history without the #
- let navigationType = performance.getEntriesByType("navigation")[0].type;
+ let navigationType;
+ if (window.performance && window.performance.getEntriesByType('navigation').length) {
+ navigationType = window.performance.getEntriesByType("navigation")[0].type;
+ } else if (performance.getEntriesByType('navigation').length) {
+ navigationType = performance.getEntriesByType("navigation")[0].type;
+ }
+ else {
+ console.log("Couldn't find the window.performance or performance to get reload information");
+ }
if ((navigationType == 'reload') && (window.location.href.indexOf('#authentication') == -1)) {
window.history.pushState('', document.title, window.location.pathname + '#authentication');
}