Skip to content

Commit

Permalink
fixed webview
Browse files Browse the repository at this point in the history
  • Loading branch information
oxdc committed Dec 25, 2024
1 parent d608d38 commit ea4f351
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/Tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,12 @@ export const Tab = ({ leaf }: TabProps) => {
}
if (Platform.isDesktop && isWebViewer) {
const webview = leaf.view as WebviewView;
webview.webview.addEventListener(
"page-title-updated",
(title: { title: string }) => setTitle(title.title)
);
if (webview.webview) {
webview.webview.addEventListener(
"page-title-updated",
(data: { title: string }) => setTitle(data.title)
);
}
menu.addSeparator();
menu.addItem((item) => {
item.setSection("webview")
Expand Down

0 comments on commit ea4f351

Please sign in to comment.