From d426b47166e13266623a8d8c5079028a5d6dc562 Mon Sep 17 00:00:00 2001 From: Calum Smith Date: Thu, 20 Feb 2025 23:49:57 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20open=20external=20links=20in=20default?= =?UTF-8?q?=20browser=20from=20macOS=20PWA=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …by using `window.open(url, "_blank", "noopener")` directly instead of a now-rarely-needed workaround. Fixes freeCodeCamp/devdocs#2438 --- assets/javascripts/lib/util.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/javascripts/lib/util.js b/assets/javascripts/lib/util.js index 3aa301bc..c8668d4f 100644 --- a/assets/javascripts/lib/util.js +++ b/assets/javascripts/lib/util.js @@ -457,13 +457,13 @@ $.noop = function () {}; $.popup = function (value) { try { + window.open(value.href || value, "_blank", "noopener"); + } catch (error) { const win = window.open(); if (win.opener) { win.opener = null; } win.location = value.href || value; - } catch (error) { - window.open(value.href || value, "_blank"); } };