diff --git a/src/frame.ts b/src/frame.ts index 098ebc0..97b1a21 100644 --- a/src/frame.ts +++ b/src/frame.ts @@ -89,8 +89,7 @@ export class CustomFrame { } } - public copyLink(): void { - let link = this.frame instanceof HTMLIFrameElement ? this.frame.contentWindow.location.href : this.frame.getURL(); - navigator.clipboard.writeText(link); + public getCurrentUrl(): string { + return this.frame instanceof HTMLIFrameElement ? this.frame.contentWindow.location.href : this.frame.getURL(); } } \ No newline at end of file diff --git a/src/view.ts b/src/view.ts index 79ad9b8..e85773d 100644 --- a/src/view.ts +++ b/src/view.ts @@ -16,7 +16,11 @@ export class CustomFrameView extends ItemView { }, { name: "Copy link", icon: "link", - action: v => v.frame.copyLink() + action: v => navigator.clipboard.writeText(v.frame.getCurrentUrl()) + }, { + name: "Open in browser", + icon: "globe", + action: v => open(v.frame.getCurrentUrl()) }, { name: "Refresh", icon: "refresh-cw",