From 12c659fb2fa21342d76b1a76c8c921117b9a48e5 Mon Sep 17 00:00:00 2001 From: Frans de Jonge Date: Wed, 11 Dec 2024 14:47:01 +0100 Subject: Always prevent default regardless of window.open() return status (#7089) * Always prevent default regardless of window.open() return status Fixes regression noted in https://github.com/FreshRSS/FreshRSS/pull/7077#discussion_r1879016226 * Update p/scripts/main.js Co-authored-by: Alexandre Alapetite --------- Co-authored-by: Alexandre Alapetite --- p/scripts/main.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'p') diff --git a/p/scripts/main.js b/p/scripts/main.js index 0093b3330..baedda55c 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -1099,10 +1099,8 @@ function init_shortcuts() { const link_go_website = document.querySelector('.flux.current a.go_website'); if (link_go_website) { - const newWindow = window.open(link_go_website.href, '_blank', 'noopener'); - if (newWindow) { - ev.preventDefault(); - } + window.open(link_go_website.href, '_blank', 'noopener'); + ev.preventDefault(); } return; } -- cgit v1.2.3