1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/movim_ynh.git synced 2024-09-03 19:46:19 +02:00
movim_ynh/sources/app/assets/js/movim_electron.js
2016-03-17 13:44:43 +01:00

13 lines
434 B
JavaScript

/**
* @brief Open the URLs in the default browser
*/
if(typeof require !== 'undefined') {
document.addEventListener('click', function(event) {
if(event.target.target == '_blank'
|| (event.target.hostname != null && event.target.hostname != BASE_HOST)) {
event.preventDefault();
var shell = require('electron').shell;
shell.openExternal(event.target.href);
}
});
}