diff --git a/js/lib/urlutil.js b/js/lib/urlutil.js index 1de02fb3116..177838add37 100644 --- a/js/lib/urlutil.js +++ b/js/lib/urlutil.js @@ -336,7 +336,7 @@ const UrlUtil = { * @return {string} */ getDisplayLocation: function (url, pdfjsEnabled) { - if (!url || ['about:blank', 'about:newtab'].includes(url)) { + if (!url || url === 'about:newtab') { return '' } const parsed = urlParse(pdfjsEnabled ? this.getLocationIfPDF(url) : url) diff --git a/test/components/navigationBarTest.js b/test/components/navigationBarTest.js index 58ff71eb679..3f38bb7f1b6 100644 --- a/test/components/navigationBarTest.js +++ b/test/components/navigationBarTest.js @@ -739,14 +739,22 @@ describe('navigationBar', function () { before(function * () { yield setup(this.app.client) yield this.app.client.waitForExist(urlInput) - yield this.app.client.keys('about:blank') - // hit enter - yield this.app.client.keys('\uE007') }) - it('hides the url', function * () { - yield this.app.client.waitUntil(function () { - return this.getValue(urlInput).then((val) => val === '') - }) + it('hides about:newtab', function * () { + yield this.app.client + .tabByUrl(this.newTabUrl) + .windowByUrl(Brave.browserWindowUrl) + .waitUntil(function () { + return this.getValue(urlInput).then((val) => val === '') + }) + }) + it('shows about:blank', function * () { + yield this.app.client + .keys('about:blank') + .keys('\uE007') + .waitUntil(function () { + return this.getValue(urlInput).then((val) => val === 'about:blank') + }) }) })