From 047c7e44102e728ca0d3bee8445adea286a80bb8 Mon Sep 17 00:00:00 2001 From: Maxence Charriere Date: Wed, 22 May 2024 16:22:09 +0800 Subject: [PATCH] navigation _blank support --- pkg/app/browser.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/app/browser.go b/pkg/app/browser.go index bdcb2438..e49b7f34 100644 --- a/pkg/app/browser.go +++ b/pkg/app/browser.go @@ -1,6 +1,8 @@ package app -import "time" +import ( + "time" +) type browser struct { AppUpdatable bool @@ -43,6 +45,11 @@ func (b *browser) handleAnchorClick(ctx Context) { return } + switch target.Get("target").String() { + case "_blank": + return + } + event.PreventDefault() if href := target.Get("href"); href.Truthy() { ctx.Navigate(target.Get("href").String())