Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

show about:blank in urlbar #5214

Merged
merged 1 commit into from
Oct 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion js/lib/urlutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
22 changes: 15 additions & 7 deletions test/components/navigationBarTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
})
})

Expand Down