mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-01-14 00:48:05 +00:00
Fix error when browser doesn't know how to deal with window.navigator.registerProtocolHandler
This commit is contained in:
parent
46fc58f69e
commit
4efada7fd8
@ -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…
Reference in New Issue
Block a user