mirror of
https://github.com/Ellpeck/ObsidianCustomFrames.git
synced 2024-11-26 11:08:35 +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 {
|
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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -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",
|
||||||
|
|
Loading…
Reference in a new issue