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:
parent
4ddf10a108
commit
d7859160eb
@ -25,9 +25,11 @@ 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('did-finish-load', function(e) {
|
||||||
webView.addEventListener('page-title-set', function(event) {
|
webView.addEventListener('page-title-set', function(event) {
|
||||||
ipc.send('notification-message', 'TITLE_CHANGED');
|
ipc.send('notification-message', 'TITLE_CHANGED');
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var webViewDiv = document.getElementById('webViewDiv');
|
var webViewDiv = document.getElementById('webViewDiv');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user