|
|
|
@ -79,14 +79,10 @@ Ext.define('Rambox.ux.WebView',{
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
webview.addEventListener("dom-ready", function(e) { |
|
|
|
|
// Mute Webview
|
|
|
|
|
if ( !webview.isAudioMuted() && me.muted ) webview.setAudioMuted(me.muted); |
|
|
|
|
|
|
|
|
|
// Open links in default browser
|
|
|
|
|
webview.addEventListener('new-window', function(e) { |
|
|
|
|
const protocol = require('url').parse(e.url).protocol; |
|
|
|
|
if (protocol === 'http:' || protocol === 'https:') { |
|
|
|
|
if (protocol === 'http:' || protocol === 'https:' || protocol === 'mailto:') { |
|
|
|
|
e.preventDefault(); |
|
|
|
|
require('electron').shell.openExternal(e.url); |
|
|
|
|
} |
|
|
|
@ -96,6 +92,10 @@ Ext.define('Rambox.ux.WebView',{
|
|
|
|
|
e.preventDefault(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
webview.addEventListener("dom-ready", function(e) { |
|
|
|
|
// Mute Webview
|
|
|
|
|
if ( !webview.isAudioMuted() && me.muted ) webview.setAudioMuted(me.muted); |
|
|
|
|
|
|
|
|
|
// Injected code to detect new messages
|
|
|
|
|
if ( me.record && me.record.get('js_unread') !== '' ) { |
|
|
|
|
console.info('JS Injected', me.src); |
|
|
|
|