Skip to content

Commit c29a2af

Browse files
committed
Add copy current url to webview context menu
1 parent 6ebed16 commit c29a2af

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

frontend/app/view/webview/webview.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,13 @@ export class WebViewModel implements ViewModel {
431431
return true;
432432
}
433433

434+
copyUrlToClipboard() {
435+
const url = this.getUrl();
436+
if (url != null && url != "") {
437+
fireAndForget(() => navigator.clipboard.writeText(url));
438+
}
439+
}
440+
434441
keyDownHandler(e: WaveKeyboardEvent): boolean {
435442
if (checkKeyPressed(e, "Cmd:l")) {
436443
this.urlInputRef?.current?.focus();
@@ -509,6 +516,10 @@ export class WebViewModel implements ViewModel {
509516

510517
const isNavHidden = globalStore.get(this.hideNav);
511518
return [
519+
{
520+
label: "Copy URL to Clipboard",
521+
click: () => this.copyUrlToClipboard(),
522+
},
512523
{
513524
label: "Set Block Homepage",
514525
click: () => fireAndForget(() => this.setHomepageUrl(this.getUrl(), "block")),

0 commit comments

Comments
 (0)