Explorar el Código

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 <alexandre@alapetite.fr>

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Frans de Jonge hace 1 año
padre
commit
12c659fb2f
Se han modificado 1 ficheros con 2 adiciones y 4 borrados
  1. 2 4
      p/scripts/main.js

+ 2 - 4
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;
 		}