Skip to content

Commit

Permalink
Register protocol handler only once
Browse files Browse the repository at this point in the history
  • Loading branch information
digital-dreamer committed Dec 4, 2014
1 parent 4f0130e commit 76d0373
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion js/interface_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,12 @@ function watchHashChange(e)
function initHashWatching()
{
// 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';
window.navigator.registerProtocolHandler('web+twister', local_twister_url, 'Twister');
_putResourceIntoStorage("twister_protocol_registered", true);
}

// Register hash spy and launch it once
Expand Down

0 comments on commit 76d0373

Please sign in to comment.