We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9210149 commit 40ff086Copy full SHA for 40ff086
frontend/src/browser.tsx
@@ -66,6 +66,22 @@ export class Browser extends StatefulClass {
66
frame.frame.addEventListener("load", (e) => {
67
tab.url = frame.client.url.href;
68
});
69
+ frame.addEventListener("contextInit", (e) => {
70
+ const framedoc = frame.frame.contentDocument!;
71
+ const head = framedoc.querySelector("head")!;
72
+ const observer = new MutationObserver(() => {
73
+ const title = framedoc.querySelector("title");
74
+ if (title) {
75
+ tab.title = title.textContent || "New Tab";
76
+ } else {
77
+ tab.title = "New Tab";
78
+ }
79
+ });
80
+ observer.observe(head, {
81
+ childList: true,
82
+ subtree: true,
83
84
85
use(tab.url).listen(() => {
86
this.activetab = this.activetab;
87
0 commit comments