Merge pull request #998 from yemel/fix/browser-extensions

Fix/browser extensions
This commit is contained in:
Gustavo Maximiliano Cortez 2014-08-01 11:54:41 -03:00
commit 313e3e4fcd
6 changed files with 25 additions and 19 deletions

16
js/mobile.js Normal file
View file

@ -0,0 +1,16 @@
'use strict';
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
setTimeout(function(){ navigator.splashscreen.hide(); }, 2000);
document.addEventListener("menubutton", function() {
var nav = document.getElementsByTagName('nav')[0];
if (!nav) return;
var menu = nav.getElementsByTagName('section')[0].getElementsByTagName('a')[0];
if (menu.offsetParent) menu.click();
}, false);
}

View file

@ -6,7 +6,8 @@ UriHandler.prototype.register = function() {
var base = window.location.origin + '/';
var url = base + '#!/uri-payment/%s';
if(navigator.registerProtocolHandler) {
var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
if(navigator.registerProtocolHandler && !isFirefox) {
navigator.registerProtocolHandler('bitcoin', url, 'Copay');
}
};