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 #9647 from brave/feature/extensions/metamask-create
Browse files Browse the repository at this point in the history
add metamask to available extensions
  • Loading branch information
bsclifton authored Jun 30, 2017
2 parents 5308897 + d319536 commit 4cc1273
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ module.exports.init = () => {
loadExtension(config.braveExtensionId, getExtensionsPath('brave'), generateBraveManifest(), 'component')
extensionInfo.setState(config.syncExtensionId, extensionStates.REGISTERED)
loadExtension(config.syncExtensionId, getExtensionsPath('brave'), generateSyncManifest(), 'unpacked')

if (getSetting(settings.TORRENT_VIEWER_ENABLED)) {
extensionInfo.setState(config.torrentExtensionId, extensionStates.REGISTERED)
loadExtension(config.torrentExtensionId, getExtensionsPath('torrent'), generateTorrentManifest(), 'component')
Expand Down Expand Up @@ -533,6 +534,12 @@ module.exports.init = () => {
disableExtension(config.pinterestExtensionId)
}

if (getSetting(settings.METAMASK_ENABLED)) {
registerComponent(config.metamaskExtensionId, config.metamaskPublicKey)
} else {
disableExtension(config.metamaskExtensionId)
}

if (appStore.getState().getIn(['widevine', 'enabled'])) {
registerComponent(config.widevineComponentId, config.widevineComponentPublicKey)
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions app/extensions/brave/locales/en-US/extensions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ honey=Honey
honeyDesc=Automatically find and apply coupon codes when you shop online!
pinterest=Pinterest
pinterestDesc=Makes it easy to save creative ideas from around the web
metamask=MetaMask
metamaskDesc=MetaMask is an extension for Ethereum-related applications
1 change: 1 addition & 0 deletions app/extensions/brave/locales/en-US/preferences.properties
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ contentSettings=Content Settings
extensions=Extensions
enableVimium=Enable Vimium
enablePinterest=Enable Pinterest
enableMetamask=Enable MetaMask
useHardwareAcceleration=Use hardware acceleration when available *
useSmoothScroll=Enable smooth scrolling *
defaultZoomLevel=Default zoom level
Expand Down
10 changes: 10 additions & 0 deletions app/renderer/lib/extensionsUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const webtorrent = config.torrentExtensionId
const vimium = config.vimiumExtensionId
const honey = config.honeyExtensionId
const pinterest = config.pinterestExtensionId
const metamask = config.metamaskExtensionId

/**
* Stores dummy data for all known extensions based on vault-updater extension manifest.
Expand Down Expand Up @@ -71,6 +72,12 @@ const dummyData = [
name: 'Pinterest Save',
description: 'pinterestDesc',
icon: 'img/extensions/pinterest-128.png'
},
{
id: metamask,
name: 'MetaMask',
description: 'metamaskDesc',
icon: 'img/extensions/metamask-128.png'
}
// { id: 'vimium' // TBD }
]
Expand Down Expand Up @@ -160,6 +167,9 @@ module.exports.getExtensionKey = (extensionId) => {
case pinterest:
extensionSetting = settings.PINTEREST_ENABLED
break
case metamask:
extensionSetting = settings.METAMASK_ENABLED
break
default:
break
}
Expand Down
1 change: 1 addition & 0 deletions js/constants/appConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ module.exports = {
'extensions.vimium.enabled': false,
'extensions.honey.enabled': false,
'extensions.pinterest.enabled': false,
'extensions.metamask.enabled': false,
'general.bookmarks-toolbar-mode': null,
'general.is-default-browser': null,
'notification-add-funds-timestamp': null,
Expand Down
13 changes: 13 additions & 0 deletions js/constants/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ module.exports = {
authUrl: (userId) => `${vaultHost}/v1/users/${userId}`,
replacementUrl: adHost
},
// The SHA256 of the SubjectPublicKeyInfo used to sign the extension.
// PublicKeySHA256 can be generated by first downloading the CRX with
// one of the URLs below. Then using:
// ./script/get-extension-public-key-sha256.py <crx_path>

// Registers a component which either already exists or not for updates
// require('electron').remote.componentUpdater.registerComponent(extensionId) // NOLINT
//
// Removes any existing extension and performs an install now.
// componentUpdater.registerComponent must have been called.
// require('electron').remote.componentUpdater.checkNow(extensionId) // NOLINT
widevineComponentId: 'oimompecagnajdejgnnjijobebaeigek',
widevineComponentPublicKey: 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCmhe+02cLPPAViaevk/fzODKUnb/ysaAeD8lpE9pwirV6GYOm+naTo7xPOCh8ujcR6Ryi1nPTq2GTG0CyqdDyOsZ1aRLuMZ5QqX3dJ9jXklS0LqGfosoIpGexfwggbiLvQOo9Q+IWTrAO620KAzYU0U6MV272TJLSmZPUEFY6IGQIDAQAB',
braveExtensionId: 'mnojpmjdmbbfmejpflffifhffcmidifd',
Expand All @@ -73,6 +84,8 @@ module.exports = {
honeyExtensionPublicKey: 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC79mayLyuCYY/dyT7Ycr1sVBp9yHrY4mnogVEgu+sDT6+/A121Na+aTw6mFLD6LHgbgHt4fnQ2V/QwcfBSXRTSkGpgNsZAjnYs4/XzZQYKGltWT93EP9zXN1kGbtzfkPGzTakquCfOjbKtbAQKWh8ppzqLhWcRUn9g/PhU99F29QIDAQAB',
pinterestExtensionId: 'gpdjojdkbbmdfjfahjcgigfpmkopogic',
pinterestExtensionPublicKey: 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDB95q2hyt49ZDuVnYI91XaZhqQkbXu0X3fzoNxPxhFbfqGKwtts90LJ7lD5DCIfnBg8WGFhp3eW4GxOglAKrnksmJoyAD5PnSAufx8fD3trZvo/ZAqFx1x5Xm3Rm34EgvVXdralgHSYiqcEU/FX3kYnLLhr2TS4lcrsn1KZd/lcQIDAQAB',
metamaskExtensionId: 'nkbihfbeogaeaoehlefnkodbefgpgknn',
metamaskPublicKey: 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlcgI4VVL4JUvo6hlSgeCZp9mGltZrzFvc2Asqzb1dDGO9baoYOe+QRoh27/YyVXugxni480Q/R147INhBOyQZVMhZOD5pFMVutia9MHMaZhgRXzrK3BHtNSkKLL1c5mhutQNwiLqLtFkMSGvka91LoMEC8WTI0wi4tACnJ5FyFZQYzvtqy5sXo3VS3gzfOBluLKi7BxYcaUJjNrhOIxl1xL2qgK5lDrDOLKcbaurDiwqofVtAFOL5sM3uJ6D8nOO9tG+T7hoobRFN+nxk43PHgCv4poicOv+NMZQEk3da1m/xfuzXV88NcE/YRbRLwAS82m3gsJZKc6mLqm4wZHzBwIDAQAB',
coinbaseOrigin: 'https://buy.coinbase.com',
newtab: {
fallbackImage: {
Expand Down
3 changes: 2 additions & 1 deletion js/constants/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ const settings = {
POCKET_ENABLED: 'extensions.pocket.enabled',
VIMIUM_ENABLED: 'extensions.vimium.enabled',
HONEY_ENABLED: 'extensions.honey.enabled',
PINTEREST_ENABLED: 'extensions.pinterest.enabled'
PINTEREST_ENABLED: 'extensions.pinterest.enabled',
METAMASK_ENABLED: 'extensions.metamask.enabled'
}

module.exports = settings

0 comments on commit 4cc1273

Please sign in to comment.