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

Commit

Permalink
Merge pull request #13345 from brave/fixMacU2F
Browse files Browse the repository at this point in the history
fix path issue preventing u2f support from working on mac
  • Loading branch information
bsclifton committed Mar 19, 2018
1 parent 780e7d5 commit 27f76a7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 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 {fileUrl} = require('../js/lib/appUrlUtil')
const {getExtensionsPath, getBraveExtUrl, getBraveExtIndexHTML} = require('../js/lib/appUrlUtil')
const {getComponentExtensionsPath, getExtensionsPath, getBraveExtUrl, getBraveExtIndexHTML} = require('../js/lib/appUrlUtil')
const {getSetting} = require('../js/settings')
const settings = require('../js/constants/settings')
const extensionStates = require('../js/constants/extensionStates')
Expand Down Expand Up @@ -527,7 +527,7 @@ module.exports.init = () => {
loadExtension(config.braveExtensionId, getExtensionsPath('brave'), generateBraveManifest(), 'component')
// Cryptotoken extension is loaded from electron_resources.pak
extensionInfo.setState(config.cryptoTokenExtensionId, extensionStates.REGISTERED)
loadExtension(config.cryptoTokenExtensionId, path.join(process.resourcesPath, 'cryptotoken'), {}, 'component')
loadExtension(config.cryptoTokenExtensionId, getComponentExtensionsPath('cryptotoken'), {}, 'component')
extensionInfo.setState(config.syncExtensionId, extensionStates.REGISTERED)
loadExtension(config.syncExtensionId, getExtensionsPath('brave'), generateSyncManifest(), 'unpacked')

Expand Down
9 changes: 9 additions & 0 deletions js/lib/appUrlUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const Immutable = require('immutable')
const path = require('path')
const UrlUtil = require('./urlutil')
const config = require('../constants/config')
const isDarwin = require('../../app/common/lib/platformUtil').isDarwin()

module.exports.fileUrl = (filePath) => {
// It's preferrable to call path.resolve but it's not available
Expand Down Expand Up @@ -62,6 +63,14 @@ module.exports.getExtensionsPath = function (extensionDir) {
: path.join(__dirname, '..', '..', 'app', 'extensions', extensionDir)
}

module.exports.getComponentExtensionsPath = function (extensionDir) {
if (isDarwin) {
return path.join(process.resourcesPath, '../Frameworks/Brave Framework.framework/Resources/', extensionDir)
} else {
return path.join(process.resourcesPath, extensionDir)
}
}

module.exports.getGenDir = function (url) {
const genDirRoots = [
module.exports.getBraveIndexPath,
Expand Down

0 comments on commit 27f76a7

Please sign in to comment.