Add "webview-dom-ready" event
This commit is contained in:
parent
b866d47157
commit
4cbbdbc033
2 changed files with 8 additions and 4 deletions
|
@ -216,6 +216,7 @@ The following events are available:
|
|||
* `tabGroup.on("tab-removed", (tab, tabGroup) => { ... });`
|
||||
* `tabGroup.on("tab-active", (tab, tabGroup) => { ... });`
|
||||
* `tab.on("webview-ready", (tab) => { ... });`
|
||||
* `tab.on("webview-dom-ready", (tab) => { ... });`
|
||||
* `tab.on("title-changed", (title, tab) => { ... });`
|
||||
* `tab.on("icon-changed", (icon, tab) => { ... });`
|
||||
* `tab.on("active", (tab) => { ... });`
|
||||
|
|
11
index.js
11
index.js
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue