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

Commit

Permalink
offer pinterest-save extension
Browse files Browse the repository at this point in the history
#6366

works with base64 extension changes to muon
see brave/muon@b346a92

Auditors:
@bridiver @jonathansampson

Test Plan:
  • Loading branch information
kevinlawler committed Jun 16, 2017
1 parent 1007e8c commit 3b3503f
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 4 deletions.
17 changes: 14 additions & 3 deletions app/extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,10 +440,15 @@ module.exports.init = () => {
}
}

let registerComponent = (extensionId) => {
let registerComponent = (extensionId, publicKeyString) => {
if (!extensionInfo.isRegistered(extensionId) && !extensionInfo.isRegistering(extensionId)) {
extensionInfo.setState(extensionId, extensionStates.REGISTERING)
componentUpdater.registerComponent(extensionId)
if (typeof publicKeyString !== "undefined") {
componentUpdater.registerComponent(extensionId, publicKeyString)
}
else {
componentUpdater.registerComponent(extensionId)
}
} else {
const extensions = extensionState.getExtensions(appStore.getState())
const extensionPath = extensions.getIn([extensionId, 'filePath'])
Expand Down Expand Up @@ -518,11 +523,17 @@ module.exports.init = () => {
}

if (getSetting(settings.HONEY_ENABLED)) {
registerComponent(config.honeyExtensionId)
registerComponent(config.honeyExtensionId, "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC79mayLyuCYY/dyT7Ycr1sVBp9yHrY4mnogVEgu+sDT6+/A121Na+aTw6mFLD6LHgbgHt4fnQ2V/QwcfBSXRTSkGpgNsZAjnYs4/XzZQYKGltWT93EP9zXN1kGbtzfkPGzTakquCfOjbKtbAQKWh8ppzqLhWcRUn9g/PhU99F29QIDAQAB")
} else {
disableExtension(config.honeyExtensionId)
}

if (getSetting(settings.PINTEREST_ENABLED)) {
registerComponent(config.pinterestExtensionId, "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDB95q2hyt49ZDuVnYI91XaZhqQkbXu0X3fzoNxPxhFbfqGKwtts90LJ7lD5DCIfnBg8WGFhp3eW4GxOglAKrnksmJoyAD5PnSAufx8fD3trZvo/ZAqFx1x5Xm3Rm34EgvVXdralgHSYiqcEU/FX3kYnLLhr2TS4lcrsn1KZd/lcQIDAQAB")
} else {
disableExtension(config.pinterestExtensionId)
}

if (appStore.getState().getIn(['widevine', 'enabled'])) {
registerComponent(config.widevineComponentId)
}
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 @@ -31,3 +31,5 @@ vimium= Vimium
vimiumDesc=
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
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 @@ -265,6 +265,7 @@ bookmarkToolbarShowOnlyFavicon=Show only favicon
contentSettings=Content Settings
extensions=Extensions
enableVimium=Enable Vimium
enablePinterest=Enable Pinterest
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 @@ -19,6 +19,7 @@ const sync = config.syncExtensionId
const webtorrent = config.torrentExtensionId
const vimium = config.vimiumExtensionId
const honey = config.honeyExtensionId
const pinterest = config.pinterestExtensionId

/**
* Stores dummy data for all known extensions based on vault-updater extension manifest.
Expand Down Expand Up @@ -60,6 +61,12 @@ const dummyData = [
name: 'honey',
description: 'honeyDesc',
icon: 'img/extensions/honey-128.png'
},
{
id: pinterest,
name: 'Pinterest Save',
description: 'pinterestDesc',
icon: 'img/extensions/pinterest-128.png'
}
// { id: 'vimium' // TBD }
]
Expand Down Expand Up @@ -146,6 +153,9 @@ module.exports.getExtensionKey = (extensionId) => {
case honey:
extensionSetting = settings.HONEY_ENABLED
break
case pinterest:
extensionSetting = settings.PINTEREST_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 @@ -205,6 +205,7 @@ module.exports = {
'extensions.pocket.enabled': false,
'extensions.vimium.enabled': false,
'extensions.honey.enabled': false,
'extensions.pinterest.enabled': false,
'general.bookmarks-toolbar-mode': null,
'general.is-default-browser': null,
'notification-add-funds-timestamp': null,
Expand Down
1 change: 1 addition & 0 deletions js/constants/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ module.exports = {
PocketExtensionId: 'niloccemoadcdkdjlinkgdfekeahmflj',
vimiumExtensionId: 'dbepggeogbaibhgnhhndojpepiihcmeb',
honeyExtensionId: 'bmnlcjabgnpnenekpadlanbbkooimhnj',
pinterestExtensionId: 'gpdjojdkbbmdfjfahjcgigfpmkopogic',
widevineComponentId: 'oimompecagnajdejgnnjijobebaeigek',
coinbaseOrigin: 'https://buy.coinbase.com',
newtab: {
Expand Down
3 changes: 2 additions & 1 deletion js/constants/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ const settings = {
SHOW_BOOKMARKS_TOOLBAR_ONLY_FAVICON: 'bookmarks.toolbar.showOnlyFavicon',
POCKET_ENABLED: 'extensions.pocket.enabled',
VIMIUM_ENABLED: 'extensions.vimium.enabled',
HONEY_ENABLED: 'extensions.honey.enabled'
HONEY_ENABLED: 'extensions.honey.enabled',
PINTEREST_ENABLED: 'extensions.pinterest.enabled'
}

module.exports = settings

0 comments on commit 3b3503f

Please sign in to comment.