From 76d037310114f805237dfe0c689220ca63b2a84b Mon Sep 17 00:00:00 2001 From: digital dreamer Date: Thu, 4 Dec 2014 21:35:27 +0100 Subject: [PATCH] Register protocol handler only once --- js/interface_common.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/interface_common.js b/js/interface_common.js index 2bc8e74..0cac230 100644 --- a/js/interface_common.js +++ b/js/interface_common.js @@ -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