mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-02-05 11:34:25 +00:00
Register protocol handler only once
This commit is contained in:
parent
4f0130e1c4
commit
76d0373101
@ -404,9 +404,12 @@ function watchHashChange(e)
|
|||||||
function initHashWatching()
|
function initHashWatching()
|
||||||
{
|
{
|
||||||
// Register custom protocol handler
|
// Register custom protocol handler
|
||||||
if (window.navigator && window.navigator.registerProtocolHandler){
|
already_registered = _getResourceFromStorage("twister_protocol_registered");
|
||||||
|
|
||||||
|
if (window.navigator && window.navigator.registerProtocolHandler && !already_registered){
|
||||||
var local_twister_url = window.location.protocol + '//' + window.location.host + '/home.html#%s';
|
var local_twister_url = window.location.protocol + '//' + window.location.host + '/home.html#%s';
|
||||||
window.navigator.registerProtocolHandler('web+twister', local_twister_url, 'Twister');
|
window.navigator.registerProtocolHandler('web+twister', local_twister_url, 'Twister');
|
||||||
|
_putResourceIntoStorage("twister_protocol_registered", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Register hash spy and launch it once
|
// Register hash spy and launch it once
|
||||||
|
Loading…
x
Reference in New Issue
Block a user