Created
September 17, 2021 21:05
-
-
Save samueleastdev/7247b168521ec99f6f6a80d2d5e551c7 to your computer and use it in GitHub Desktop.
Opens an Electron app from browser or asked them to install it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var timeout; | |
document.getElementById('link').addEventListener('click', function(e) { | |
timeout = window.setTimeout(function() { | |
alert('install app'); | |
}, 1000); | |
window.location = "app://"; | |
e.preventDefault(); | |
}); | |
window.addEventListener('blur', function(e) { | |
window.clearTimeout(timeout); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment