From c5dd2a93bea3e3a18eb1eb2068e6d3f1bde60a13 Mon Sep 17 00:00:00 2001 From: Brian Clifton Date: Thu, 13 Sep 2018 00:30:53 -0700 Subject: [PATCH] Merge pull request #15194 from brave/fix/15162 Fix about:blank appearing on new tab in new windows --- js/lib/urlutil.js | 2 +- test/unit/lib/urlutilTestComponents.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js/lib/urlutil.js b/js/lib/urlutil.js index e5ee4807127..9a097246f96 100644 --- a/js/lib/urlutil.js +++ b/js/lib/urlutil.js @@ -429,7 +429,7 @@ const UrlUtil = { */ openableByContextMenu: function (url) { if (!url) { - return false + return true } const protocol = urlParse(url).protocol // file: is untrusted but handled in a separate check diff --git a/test/unit/lib/urlutilTestComponents.js b/test/unit/lib/urlutilTestComponents.js index 01e649ca687..3c7adcfbb1d 100644 --- a/test/unit/lib/urlutilTestComponents.js +++ b/test/unit/lib/urlutilTestComponents.js @@ -341,6 +341,9 @@ module.exports = { }, 'is about:blank': (test) => { test.equal(urlUtil().openableByContextMenu('about:blank'), true) + }, + 'is empty': (test) => { + test.equal(urlUtil().openableByContextMenu(), true) } }, 'returns false when input:': { @@ -349,9 +352,6 @@ module.exports = { }, 'is ssh:': (test) => { test.equal(urlUtil().openableByContextMenu('ssh://test@127.0.0.1'), false) - }, - 'is null': (test) => { - test.equal(urlUtil().openableByContextMenu(null), false) } } },