Browse Source

Merge pull request #2439 from cpmsmith/window-open-noopener

fix: open external links in default browser from macOS PWA
Simon Legner 9 months ago
parent
commit
03c4c5e6f9
1 changed files with 2 additions and 2 deletions
  1. 2 2
      assets/javascripts/lib/util.js

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