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

Commit

Permalink
Remove Brave software links from urlbar suggestions
Browse files Browse the repository at this point in the history
fix #7655

Auditors: @bsclifton

Test Plan:
1. open a clean instance of brave
2. type 'face' into the urlbar
3. it should autocomplete to facebook instead of Brave's facebook page
  • Loading branch information
diracdeltas authored and bsclifton committed Mar 14, 2017
1 parent 1a2f1fc commit fa2eb80
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions js/data/newTabData.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,5 @@ module.exports.topSites = [
"title": "Brave Browser: Fast AdBlock – Apps para Android no Google Play"
}
]

module.exports.topSiteLocations = module.exports.topSites.map((site) => site.location)
14 changes: 13 additions & 1 deletion js/stores/appStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const Filtering = require('../../app/filtering')
const basicAuth = require('../../app/browser/basicAuth')
const webtorrent = require('../../app/browser/webtorrent')
const windows = require('../../app/browser/windows')
const { topSiteLocations } = require('../data/newTabData')
const assert = require('assert')

// state helpers
Expand Down Expand Up @@ -421,9 +422,20 @@ const handleAppAction = (action) => {
appState = appState.set('passwords', new Immutable.List())
break
case appConstants.APP_CHANGE_NEW_TAB_DETAIL:
// If a site is pinned, add it to the sites if it isn't already there.
if (action.newTabPageDetail) {
let pinnedTopSites = action.newTabPageDetail.get('pinnedTopSites')
if (pinnedTopSites) {
pinnedTopSites.forEach((site) => {
if (site && topSiteLocations.includes(site.get('location'))) {
appState = appState.set('sites', siteUtil.addSite(appState.get('sites'), site))
}
})
}
}
appState = aboutNewTabState.mergeDetails(appState, action)
if (action.refresh) {
appState = aboutNewTabState.setSites(appState, action)
appState = aboutNewTabState.setSites(appState)
}
break
case appConstants.APP_POPULATE_HISTORY:
Expand Down

0 comments on commit fa2eb80

Please sign in to comment.