From 8085f6373e6913b3b885a5b151a39986fc8fc190 Mon Sep 17 00:00:00 2001 From: Jonathan Sampson Date: Fri, 7 Apr 2017 16:21:56 -0500 Subject: [PATCH] Adds support for Honey, and resolves a couple bugs --- app/common/state/extensionState.js | 2 +- app/extensions.js | 6 ++++++ .../brave/img/extensions/honey-128.png | Bin 0 -> 16030 bytes .../brave/locales/en-US/extensions.properties | 2 ++ .../components/navigation/browserAction.js | 9 ++++++++- app/renderer/lib/extensionsUtil.js | 10 ++++++++++ docs/state.md | 1 + js/constants/appConfig.js | 1 + js/constants/config.js | 1 + js/constants/settings.js | 3 ++- test/about/extensionsTest.js | 13 +++++++++++++ 11 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 app/extensions/brave/img/extensions/honey-128.png diff --git a/app/common/state/extensionState.js b/app/common/state/extensionState.js index 237df58e6e5..87a1b7a3298 100644 --- a/app/common/state/extensionState.js +++ b/app/common/state/extensionState.js @@ -76,7 +76,7 @@ const extensionState = { browserActionBackgroundImage: (browserAction, tabId) => { tabId = tabId ? tabId.toString() : '-1' - let path = browserAction.get('path') + let path = browserAction.getIn(['tabs', tabId, 'path']) || browserAction.get('path') let basePath = browserAction.get('base_path') if (path && basePath) { // Older extensions may provide a string path diff --git a/app/extensions.js b/app/extensions.js index b6f086b48a6..ca9cb901f3e 100644 --- a/app/extensions.js +++ b/app/extensions.js @@ -519,6 +519,12 @@ module.exports.init = () => { disableExtension(config.vimiumExtensionId) } + if (getSetting(settings.HONEY_ENABLED)) { + registerComponent(config.honeyExtensionId) + } else { + disableExtension(config.honeyExtensionId) + } + if (appStore.getState().getIn(['widevine', 'enabled'])) { registerComponent(config.widevineComponentId) } diff --git a/app/extensions/brave/img/extensions/honey-128.png b/app/extensions/brave/img/extensions/honey-128.png new file mode 100644 index 0000000000000000000000000000000000000000..6446c23650a13a1e084759e15024c7c11dbd96e4 GIT binary patch literal 16030 zcmV;PK4HO$P)0V;|EGMShJ(9i@z<_bxrsH#+@=IM;@ z`}Y6$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S$&1q5uh&mq)h+gkQ3wJrM;@QZN};gm0RFZmw0z+b0t269Az!U!k6RYp>g!N9}b-) ze2Zimk6!#&KjCL%4tWQeaw8t4YK2eTvA9F`_V`d0IS-xF*ha!mAExh~XI#mv7@5{s zyXPEU&#`4#-HzmaE7%0D@i>QYXhDH{f<>{nn3!70Y{G*md=y;-#}hV|;%zrBf|lXM zwi4^rIP?$xZ;f}Jmf%BYEWAm7_>W(hkK8a`wEt}IlTWku(MelkABG&UUx=hn%kiNf zVSh6ygoH2%w3^1=xCc=zz4N4)5; zNZ4AuWXxZRkHjzHrCIW!JM2VJ!WJdLcW}$?+p`6{abOnkcGCLLS*OC%jW+DB!~1sv zLlCiWIufjL7TJ1oY!@XsDUUHmY0$UF2d11{z}q9JkyQFw`>XJk;N%|#@4z-?Q9w0!ZT*7SJh|UemoOsu@Ll7N)x-# z!!MqljEFn!zYTmAXz;asCg(M-J!6b1YVsW8%O-|v%&^9y_s9N4L#TXoKge~w7#s10 zs~%<6uRif{AE2+~ZVn7q~au1k{Bm3Zjyys{tKCi|Lqndbsu zY0mh%?jd$u==8a9odPQUlB*spt2dIt`p<2R!q_tDlk8EL!TE$9pl%;;|Mh9UBwA+a2sVA;Uam zgz2=S;1f6FQ{w4LXZ3hDFAHy^4dxf|%G4-JtV{8!r0iBN`BiwG0^g;Fn~#5w^gj|g zCz*I0DJ{Q9bd4z-ZMy70mg3CQLPyE2#FL8w3y`WicguF YKP#YUj@>7NO#lD@07*qoM6N<$f?US79{>OV 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 d75d7961b82..7df05a73390 100644 --- a/app/extensions/brave/locales/en-US/extensions.properties +++ b/app/extensions/brave/locales/en-US/extensions.properties @@ -29,3 +29,5 @@ torrent= Torrent Viewer torrentDesc=Uses WebTorrent to display torrents directly in the browser. Supports torrent files and magnet links. vimium= Vimium vimiumDesc= +honey=Honey +honeyDesc=Automatically find and apply coupon codes when you shop online! diff --git a/app/renderer/components/navigation/browserAction.js b/app/renderer/components/navigation/browserAction.js index 4017e12874c..0362db5a350 100644 --- a/app/renderer/components/navigation/browserAction.js +++ b/app/renderer/components/navigation/browserAction.js @@ -55,7 +55,14 @@ class BrowserAction extends React.Component { const currentWindow = state.get('currentWindow') const activeFrame = frameStateUtil.getActiveFrame(currentWindow) || Immutable.Map() const activeTabId = activeFrame.get('tabId') || tabState.TAB_ID_NONE - const browserActions = extensionState.getBrowserActionByTabId(state, ownProps.extensionId, activeTabId) + let browserActions = extensionState.getBrowserActionByTabId(state, ownProps.extensionId, activeTabId) + let tabAction = browserActions.getIn(['tabs', activeTabId.toString()]) + + if (tabAction) { + tabAction = tabAction.set('title', browserActions.get('title')) + tabAction = tabAction.set('base_path', browserActions.get('base_path')) + browserActions = tabAction + } const props = {} // used in renderer diff --git a/app/renderer/lib/extensionsUtil.js b/app/renderer/lib/extensionsUtil.js index cfbff015b68..31763fbcece 100644 --- a/app/renderer/lib/extensionsUtil.js +++ b/app/renderer/lib/extensionsUtil.js @@ -18,6 +18,7 @@ const pocket = config.PocketExtensionId const sync = config.syncExtensionId const webtorrent = config.torrentExtensionId const vimium = config.vimiumExtensionId +const honey = config.honeyExtensionId /** * Stores dummy data for all known extensions based on vault-updater extension manifest. @@ -49,6 +50,12 @@ const dummyData = [ name: 'saveToPocket', description: 'saveToPocketDesc', icon: 'img/extensions/pocket-128.png' + }, + { + id: honey, + name: 'honey', + description: 'honeyDesc', + icon: 'img/extensions/honey-128.png' } // { id: 'vimium' // TBD } ] @@ -132,6 +139,9 @@ module.exports.getExtensionKey = (extensionId) => { case vimium: extensionSetting = settings.VIMIUM_ENABLED break + case honey: + extensionSetting = settings.HONEY_ENABLED + break default: break } diff --git a/docs/state.md b/docs/state.md index 9a69bacb0cb..dfcb7d77900 100644 --- a/docs/state.md +++ b/docs/state.md @@ -172,6 +172,7 @@ AppStore 'bookmarks.toolbar.showOnlyFavicon': boolean, // true if only favicons should be shown on the bookmarks toolbar 'extensions.pocket.enabled': boolean, // true if pocket is enabled 'extensions.vimium.enabled': boolean, // true if vimium is enabled + 'extensions.honey.enabled': boolean, // true if Honey is enabled 'general.autohide-menu': boolean, // true if the Windows menu should be autohidden 'general.bookmarks-toolbar-mode': boolean, // true to show bookmakrs toolbar 'general.check-default-on-startup': boolean, // true to check whether brave is default browser on startup diff --git a/js/constants/appConfig.js b/js/constants/appConfig.js index 7dd3c1f07a5..44816bab544 100644 --- a/js/constants/appConfig.js +++ b/js/constants/appConfig.js @@ -203,6 +203,7 @@ module.exports = { 'shutdown.clear-site-settings': false, 'extensions.pocket.enabled': false, 'extensions.vimium.enabled': false, + 'extensions.honey.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 3894edf56fb..7c6c7515652 100644 --- a/js/constants/config.js +++ b/js/constants/config.js @@ -50,6 +50,7 @@ module.exports = { PDFJSExtensionId: 'jdbefljfgobbmcidnmpjamcbhnbphjnb', PocketExtensionId: 'niloccemoadcdkdjlinkgdfekeahmflj', vimiumExtensionId: 'dbepggeogbaibhgnhhndojpepiihcmeb', + honeyExtensionId: 'bmnlcjabgnpnenekpadlanbbkooimhnj', widevineComponentId: 'oimompecagnajdejgnnjijobebaeigek', coinbaseOrigin: 'https://buy.coinbase.com', newtab: { diff --git a/js/constants/settings.js b/js/constants/settings.js index 9b49afda850..ac64034e8af 100644 --- a/js/constants/settings.js +++ b/js/constants/settings.js @@ -96,7 +96,8 @@ const settings = { SHOW_BOOKMARKS_TOOLBAR_FAVICON: 'bookmarks.toolbar.showFavicon', SHOW_BOOKMARKS_TOOLBAR_ONLY_FAVICON: 'bookmarks.toolbar.showOnlyFavicon', POCKET_ENABLED: 'extensions.pocket.enabled', - VIMIUM_ENABLED: 'extensions.vimium.enabled' + VIMIUM_ENABLED: 'extensions.vimium.enabled', + HONEY_ENABLED: 'extensions.honey.enabled' } module.exports = settings diff --git a/test/about/extensionsTest.js b/test/about/extensionsTest.js index 4a9e59f3717..8d5655bf5cf 100644 --- a/test/about/extensionsTest.js +++ b/test/about/extensionsTest.js @@ -49,6 +49,19 @@ describe('about:extensions', function () { .url(pocketURL) }) }) + describe('Honey', function () { + Brave.beforeAll(this) + before(function * () { + yield setup(this.app.client) + }) + it('installs when preference is enabled', function * () { + yield this.app.client + .windowByUrl(Brave.browserWindowUrl) + .changeSetting(settingsConst.HONEY_ENABLED, true) + .tabByIndex(0) + .waitForVisible('[data-extension-id="bmnlcjabgnpnenekpadlanbbkooimhnj"]', extensionDownloadWaitTime) + }) + }) describe('Vimium', function () { Brave.beforeAll(this) before(function * () {