From 33316ae7bedf4c29e4c720380d653fc1268e9b46 Mon Sep 17 00:00:00 2001 From: kevinlawler Date: Fri, 16 Jun 2017 11:12:34 -0700 Subject: [PATCH] offer pinterest-save extension brave/browser-laptop#6366 works with base64 extension changes to muon see https://github.com/brave/muon/commit/b346a92d64b5b99862fa182c0bc5d7d06306acac Auditors: @bridiver @jonathansampson Test Plan: linting Auditors: Test Plan: move public keys to config file Auditors: Test Plan: --- app/extensions.js | 16 +++++++++++++--- .../brave/img/extensions/pinterest-128.png | Bin 0 -> 7334 bytes .../brave/locales/en-US/extensions.properties | 2 ++ .../brave/locales/en-US/preferences.properties | 1 + app/renderer/lib/extensionsUtil.js | 10 ++++++++++ js/constants/appConfig.js | 1 + js/constants/config.js | 3 +++ js/constants/settings.js | 3 ++- 8 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 app/extensions/brave/img/extensions/pinterest-128.png diff --git a/app/extensions.js b/app/extensions.js index a5ebf75006f..a56f3c96be2 100644 --- a/app/extensions.js +++ b/app/extensions.js @@ -440,10 +440,14 @@ 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']) @@ -518,11 +522,17 @@ module.exports.init = () => { } if (getSetting(settings.HONEY_ENABLED)) { - registerComponent(config.honeyExtensionId) + registerComponent(config.honeyExtensionId, config.honeyExtensionPublicKey) } else { disableExtension(config.honeyExtensionId) } + if (getSetting(settings.PINTEREST_ENABLED)) { + registerComponent(config.pinterestExtensionId, config.pinterestExtensionPublicKey) + } else { + disableExtension(config.pinterestExtensionId) + } + if (appStore.getState().getIn(['widevine', 'enabled'])) { registerComponent(config.widevineComponentId) } diff --git a/app/extensions/brave/img/extensions/pinterest-128.png b/app/extensions/brave/img/extensions/pinterest-128.png new file mode 100644 index 0000000000000000000000000000000000000000..95553c2abfa428bc00656e824fa458ed68ac5bf5 GIT binary patch literal 7334 zcmX9@Wmp_dv)#pAgF|q44Q`8jfZ+b(3GTMI2S{*dA;E$NU0j0O;w}jg+}-cyyFX^; zdAh2*r>CpVIn@)ZrJ;z8L5=|c0I-#nkbf5%3jE$DX*mi2P&z5g$>{p#9_IxF z>drL|1_u=IpJt8m_$8|iNy{o(;pw8q=prH*5fREY$nwTeyU3J{G}6gdtov7F+&IcJ zO2%6_r74&-j)2Y-{FDKhjI`2p5$$NQYEfCrOj%hTC)Ac!1boA}3k-E&DQZdDl%;^0 zti}m&Wyj4jl9cod9#Mu9ge^YHMxg?YgIrbt5%Am6l9h_6GB;@}@d7CU0PDR}Y!@e| zl6=K~x9b%6$I8?)^A|4r_Zs9cBkrnKdjbhuD?_kP>3CwQ`z(UAGynrUyy+W4`^Q=i z^p~$e;<%D$!DpNIqf)?z3-LfopV`4nA}%R?-=bpZ+5G^fV(Lqv3jZdSMQFcOm)^&b z#3Hro^ui^MGDCT^*@%!LJ7m@V!OKmUEtXk+G;VI+)-DFO`^&g_KyIXqfRG-`e2Xj= z8lr(k-6FF+ojWH7zb0s(g{TmQhj8o@*(hwoLmX!APv);cRu%q3H`G=0lm&R&G587p>%;#9}aT%D8UumzPKx-eZb|8bSqQeGeF+e=THZi=d zfK0Xkyl~GO3sok+W}`0zfy?4fRl4y^#P$7}im#_S^XadKeLB0X>RxAs?W?}>y(442 z4BtD5>;<~Ifm?)MNsLXgFCQG|@VpW4RNJ4ISfcy}WNdF-1L=%A`{0y3-v+9ZKJ4)OJ5Tw11AOCC@H}kQ<`ho(BDVcy;cC1e#Qw^-H&>P zXbF3hhj*O=gO~Q(P}L7roJlW=rgO`#4dpFD7=MmG(i?urKi{xUW+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@wfmC*Ka?v7_dJE|p3XE!JXNOgS*l CB}gX# literal 0 HcmV?d00001 diff --git a/app/extensions/brave/locales/en-US/extensions.properties b/app/extensions/brave/locales/en-US/extensions.properties index 7df05a73390..f640cb45008 100644 --- a/app/extensions/brave/locales/en-US/extensions.properties +++ b/app/extensions/brave/locales/en-US/extensions.properties @@ -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 diff --git a/app/extensions/brave/locales/en-US/preferences.properties b/app/extensions/brave/locales/en-US/preferences.properties index 545a9c5d1ff..01185562ce7 100644 --- a/app/extensions/brave/locales/en-US/preferences.properties +++ b/app/extensions/brave/locales/en-US/preferences.properties @@ -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 diff --git a/app/renderer/lib/extensionsUtil.js b/app/renderer/lib/extensionsUtil.js index a2962a6ae4c..47aa2e5ab56 100644 --- a/app/renderer/lib/extensionsUtil.js +++ b/app/renderer/lib/extensionsUtil.js @@ -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. @@ -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 } ] @@ -146,6 +153,9 @@ module.exports.getExtensionKey = (extensionId) => { case honey: extensionSetting = settings.HONEY_ENABLED break + case pinterest: + extensionSetting = settings.PINTEREST_ENABLED + break default: break } diff --git a/js/constants/appConfig.js b/js/constants/appConfig.js index 1ad92fe73b8..6c8985f0c5f 100644 --- a/js/constants/appConfig.js +++ b/js/constants/appConfig.js @@ -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, diff --git a/js/constants/config.js b/js/constants/config.js index 11c426bd428..3132684ca5a 100644 --- a/js/constants/config.js +++ b/js/constants/config.js @@ -54,6 +54,9 @@ module.exports = { PocketExtensionId: 'niloccemoadcdkdjlinkgdfekeahmflj', vimiumExtensionId: 'dbepggeogbaibhgnhhndojpepiihcmeb', honeyExtensionId: 'bmnlcjabgnpnenekpadlanbbkooimhnj', + honeyExtensionPublicKey: 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC79mayLyuCYY/dyT7Ycr1sVBp9yHrY4mnogVEgu+sDT6+/A121Na+aTw6mFLD6LHgbgHt4fnQ2V/QwcfBSXRTSkGpgNsZAjnYs4/XzZQYKGltWT93EP9zXN1kGbtzfkPGzTakquCfOjbKtbAQKWh8ppzqLhWcRUn9g/PhU99F29QIDAQAB', + pinterestExtensionId: 'gpdjojdkbbmdfjfahjcgigfpmkopogic', + pinterestExtensionPublicKey: 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDB95q2hyt49ZDuVnYI91XaZhqQkbXu0X3fzoNxPxhFbfqGKwtts90LJ7lD5DCIfnBg8WGFhp3eW4GxOglAKrnksmJoyAD5PnSAufx8fD3trZvo/ZAqFx1x5Xm3Rm34EgvVXdralgHSYiqcEU/FX3kYnLLhr2TS4lcrsn1KZd/lcQIDAQAB', widevineComponentId: 'oimompecagnajdejgnnjijobebaeigek', coinbaseOrigin: 'https://buy.coinbase.com', newtab: { diff --git a/js/constants/settings.js b/js/constants/settings.js index 674403e20a7..5024b1cb55b 100644 --- a/js/constants/settings.js +++ b/js/constants/settings.js @@ -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