2
2
mirror of https://github.com/Llewellynvdm/nativefier.git synced 2025-02-02 19:58:24 +00:00

Only set the title listener after the webview finishes loading

This commit is contained in:
Jia Hao 2015-07-06 11:45:55 +08:00
parent 4ddf10a108
commit d7859160eb

View File

@ -25,8 +25,10 @@ ipc.on('params', function(message) {
// We check for desktop notifications by listening to a title change in the webview // We check for desktop notifications by listening to a title change in the webview
// Not elegant, but it will have to do // Not elegant, but it will have to do
if (appArgs.badge) { if (appArgs.badge) {
webView.addEventListener('page-title-set', function(event) { webView.addEventListener('did-finish-load', function(e) {
ipc.send('notification-message', 'TITLE_CHANGED'); webView.addEventListener('page-title-set', function(event) {
ipc.send('notification-message', 'TITLE_CHANGED');
});
}); });
} }