Browse Source

Fix error when browser doesn't know how to deal with window.navigator.registerProtocolHandler

master
Étienne Deparis 10 years ago
parent
commit
4efada7fd8
  1. 6
      js/interface_common.js

6
js/interface_common.js

@ -377,8 +377,10 @@ function watchHashChange(e) @@ -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);

Loading…
Cancel
Save