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

Commit

Permalink
extension icons should appear (macOS)
Browse files Browse the repository at this point in the history
changes file:// to chrome://brave

Issue #11142

Auditors:
@bridiver @diracdeltas @darkdh @jonathansampson

fix whitespace
  • Loading branch information
kevinlawler committed Sep 25, 2017
1 parent 2513065 commit b0b367b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const extensionActions = require('./common/actions/extensionActions')
const config = require('../js/constants/config')
const appConfig = require('../js/constants/appConfig')
const messages = require('../js/constants/messages')
const {fileUrl} = require('../js/lib/appUrlUtil')
const {chromeUrl} = require('../js/lib/appUrlUtil')
const {getExtensionsPath, getBraveExtUrl, getBraveExtIndexHTML} = require('../js/lib/appUrlUtil')
const {getSetting} = require('../js/settings')
const settings = require('../js/constants/settings')
Expand Down Expand Up @@ -393,7 +393,9 @@ module.exports.init = () => {
extensionInfo.setState(installInfo.id, extensionStates.ENABLED)
extensionInfo.setInstallInfo(installInfo.id, installInfo)
installInfo.filePath = installInfo.base_path
installInfo.base_path = fileUrl(installInfo.base_path)

installInfo.base_path = chromeUrl(installInfo.base_path)

extensionActions.extensionInstalled(installInfo.id, installInfo)
extensionActions.extensionEnabled(installInfo.id)
})
Expand Down
7 changes: 7 additions & 0 deletions js/lib/appUrlUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ module.exports.fileUrl = (filePath) => {
return encodeURI('file://' + fileUrlPath)
}

module.exports.chromeUrl = (filePath = '') => {
filePath = module.exports.fileUrl(filePath)
filePath = filePath.replace('file://', 'chrome://brave')

return filePath
}

/**
* Gets the URL of a page hosted by the braveExtension or torrentExtension
* Returns 'chrome-extension://<...>'
Expand Down

0 comments on commit b0b367b

Please sign in to comment.