Added "open in browser" button

Closes #32
This commit is contained in:
Ell 2022-06-01 15:22:33 +02:00
parent cd0285c2dd
commit dd8f3054ee
2 changed files with 7 additions and 4 deletions

View file

@ -89,8 +89,7 @@ export class CustomFrame {
} }
} }
public copyLink(): void { public getCurrentUrl(): string {
let link = this.frame instanceof HTMLIFrameElement ? this.frame.contentWindow.location.href : this.frame.getURL(); return this.frame instanceof HTMLIFrameElement ? this.frame.contentWindow.location.href : this.frame.getURL();
navigator.clipboard.writeText(link);
} }
} }

View file

@ -16,7 +16,11 @@ export class CustomFrameView extends ItemView {
}, { }, {
name: "Copy link", name: "Copy link",
icon: "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", name: "Refresh",
icon: "refresh-cw", icon: "refresh-cw",