From 4efada7fd8eb7a2e46ee7ae2fc2547fe8f19cf33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Deparis?= Date: Tue, 21 Oct 2014 00:33:14 +0200 Subject: [PATCH] Fix error when browser doesn't know how to deal with window.navigator.registerProtocolHandler --- js/interface_common.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/interface_common.js b/js/interface_common.js index 7ac983c..8edbcba 100644 --- a/js/interface_common.js +++ b/js/interface_common.js @@ -377,8 +377,10 @@ function watchHashChange(e) function initHashWatching() { // Register custom protocol handler - var local_twister_url = window.location.protocol + '//' + window.location.host + '/home.html#%s'; - window.navigator.registerProtocolHandler('web+twister', local_twister_url, 'Twister'); + if (window.navigator && window.navigator.registerProtocolHandler){ + var local_twister_url = window.location.protocol + '//' + window.location.host + '/home.html#%s'; + window.navigator.registerProtocolHandler('web+twister', local_twister_url, 'Twister'); + } // Register hash spy and launch it once window.addEventListener('hashchange', watchHashChange, false);