mirror of
https://github.com/Ellpeck/ObsidianCustomFrames.git
synced 2024-11-22 09:43:30 +01:00
parent
cd0285c2dd
commit
dd8f3054ee
2 changed files with 7 additions and 4 deletions
|
@ -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();
|
||||
}
|
||||
}
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue