diff --git a/app/extensions.js b/app/extensions.js index 43251873f62..dffa887a095 100644 --- a/app/extensions.js +++ b/app/extensions.js @@ -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') @@ -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) }) diff --git a/js/lib/appUrlUtil.js b/js/lib/appUrlUtil.js index 7a6f334307d..24f3b7f5cfc 100644 --- a/js/lib/appUrlUtil.js +++ b/js/lib/appUrlUtil.js @@ -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://<...>'