mirror of
https://ark.sudovanilla.org/Korbs/electron-tabs.git
synced 2025-01-11 05:13:54 +00:00
Added 'webview-ready' event
Added a 'webview-ready' event, which is fired, after the 'did-finish-load' event of the webview was fired.
This commit is contained in:
parent
8db8047320
commit
88f40b1c79
8
index.js
8
index.js
|
@ -294,6 +294,13 @@ const TabPrivate = {
|
||||||
|
|
||||||
initWebview: function () {
|
initWebview: function () {
|
||||||
this.webview = document.createElement("webview");
|
this.webview = document.createElement("webview");
|
||||||
|
|
||||||
|
const tabWebviewDidFinishLoadHandler = function (e) {
|
||||||
|
this.emit("webview-ready", this);
|
||||||
|
};
|
||||||
|
|
||||||
|
this.webview.addEventListener("did-finish-load", tabWebviewDidFinishLoadHandler.bind(this), false);
|
||||||
|
|
||||||
this.webview.classList.add(this.tabGroup.options.viewClass);
|
this.webview.classList.add(this.tabGroup.options.viewClass);
|
||||||
if (this.webviewAttributes) {
|
if (this.webviewAttributes) {
|
||||||
let attrs = this.webviewAttributes;
|
let attrs = this.webviewAttributes;
|
||||||
|
@ -301,6 +308,7 @@ const TabPrivate = {
|
||||||
this.webview.setAttribute(key, attrs[key]);
|
this.webview.setAttribute(key, attrs[key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.tabGroup.viewContainer.appendChild(this.webview);
|
this.tabGroup.viewContainer.appendChild(this.webview);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue