diff --git a/README.md b/README.md index 93c2fd5..4d9b0e4 100644 --- a/README.md +++ b/README.md @@ -207,6 +207,7 @@ The following events are available: * `tab.on("title-changed", (title, tab) => { ... });` * `tab.on("icon-changed", (icon, tab) => { ... });` * `tab.on("active", (tab) => { ... });` +* `tab.on("inactive", (tab) => { ... });` * `tab.on("visible", (tab) => { ... });` * `tab.on("hidden", (tab) => { ... });` * `tab.on("flash", (tab) => { ... });` diff --git a/index.js b/index.js index 7a81246..8d088cf 100644 --- a/index.js +++ b/index.js @@ -181,6 +181,7 @@ class Tab extends EventEmitter { if (this.isClosed) return; let span = this.tabElements.title; span.innerHTML = title; + span.title = title; this.title = title; this.emit("title-changed", title, this); return this; @@ -284,6 +285,7 @@ class Tab extends EventEmitter { if (activeTab) { activeTab.tab.classList.remove("active"); activeTab.webview.classList.remove("visible"); + activeTab.emit("inactive", activeTab); } TabGroupPrivate.setActiveTab.bind(this.tabGroup)(this); this.tab.classList.add("active"); @@ -417,3 +419,4 @@ const TabPrivate = { }; module.exports = TabGroup; +