Add "webview-dom-ready" event

This commit is contained in:
Thomas Brouard 2020-02-28 10:33:20 +01:00
parent b866d47157
commit 4cbbdbc033
2 changed files with 8 additions and 4 deletions

View file

@ -403,11 +403,14 @@ const TabPrivate = {
this.webview.addEventListener("did-finish-load", tabWebviewDidFinishLoadHandler.bind(this), false);
this.webview.addEventListener("dom-ready", function () {
const tabWebviewDomReadyHandler = function (e) {
// Remove this once https://github.com/electron/electron/issues/14474 is fixed
webview.blur();
webview.focus();
});
webview.blur();
webview.focus();
this.emit("webview-dom-ready", this);
};
this.webview.addEventListener("dom-ready", tabWebviewDomReadyHandler.bind(this), false);
this.webview.classList.add(this.tabGroup.options.viewClass);
if (this.webviewAttributes) {