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

Commit

Permalink
Add Vimium
Browse files Browse the repository at this point in the history
Auditors: @bridiver
  • Loading branch information
bbondy committed Mar 8, 2017
1 parent 83c55eb commit ce004b9
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 3 deletions.
6 changes: 6 additions & 0 deletions app/extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,12 @@ module.exports.init = () => {
disableExtension(config.PocketExtensionId)
}

if (getSetting(settings.VIMIUM_ENABLED)) {
registerComponent(config.vimiumExtensionId)
} else {
disableExtension(config.vimiumExtensionId)
}

if (appStore.getState().getIn(['widevine', 'enabled'])) {
registerComponent(config.widevineComponentId)
}
Expand Down
5 changes: 3 additions & 2 deletions app/extensions/brave/locales/en-US/preferences.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
preferences=Preferences
preferences=Preferences
settings=Settings
general=General
search=Search
Expand Down Expand Up @@ -242,6 +242,7 @@ bookmarkToolbarShowOnlyFavicon=Show only favicon
contentSettings=Content Settings
extensions=Extensions
enablePocket=Enable Pocket
enableVimium=Enable Vimium
moreExtensionsComingSoon=More extensions coming soon…
viewInstalledExtensions=View Installed Extensions…
useHardwareAcceleration=Use hardware acceleration when available *
Expand Down Expand Up @@ -344,4 +345,4 @@ checkDefaultOnStartup=Always check on startup
useTorrentViewer=Enable Torrent Viewer *
dashboardSettingsTitle=Dashboard
dashboardShowImages=Show images
requiresRestart=* Requires browser restart
requiresRestart=* Requires browser restart
1 change: 1 addition & 0 deletions docs/state.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ AppStore
'bookmarks.toolbar.showFavicon': boolean, // true if bookmark favicons should be shown on the bookmarks toolbar
'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
'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
Expand Down
1 change: 1 addition & 0 deletions js/about/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,7 @@ class AdvancedTab extends ImmutableComponent {
<SettingCheckbox dataL10nId='usePDFJS' prefKey={settings.PDFJS_ENABLED} settings={this.props.settings} onChangeSetting={this.props.onChangeSetting} />
<SettingCheckbox dataL10nId='useTorrentViewer' prefKey={settings.TORRENT_VIEWER_ENABLED} settings={this.props.settings} onChangeSetting={this.props.onChangeSetting} />
<SettingCheckbox dataL10nId='enablePocket' prefKey={settings.POCKET_ENABLED} settings={this.props.settings} onChangeSetting={this.props.onChangeSetting} />
<SettingCheckbox dataL10nId='enableVimium' prefKey={settings.VIMIUM_ENABLED} settings={this.props.settings} onChangeSetting={this.props.onChangeSetting} />
<Button l10nId='viewInstalledExtensions' className='primaryButton viewExtensionsInfo'
onClick={aboutActions.newFrame.bind(null, {
location: 'about:extensions'
Expand Down
1 change: 1 addition & 0 deletions js/constants/appConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ module.exports = {
'shutdown.clear-autofill-data': false,
'shutdown.clear-site-settings': false,
'extensions.pocket.enabled': false,
'extensions.vimium.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 @@ -49,6 +49,7 @@ module.exports = {
syncExtensionId: 'cjnmeadmgmiihncdidmfiabhenbggfjm',
PDFJSExtensionId: 'jdbefljfgobbmcidnmpjamcbhnbphjnb',
PocketExtensionId: 'niloccemoadcdkdjlinkgdfekeahmflj',
vimiumExtensionId: 'dbepggeogbaibhgnhhndojpepiihcmeb',
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 @@ -88,7 +88,8 @@ const settings = {
// > phased out with 0.12.6
SHOW_BOOKMARKS_TOOLBAR_FAVICON: 'bookmarks.toolbar.showFavicon',
SHOW_BOOKMARKS_TOOLBAR_ONLY_FAVICON: 'bookmarks.toolbar.showOnlyFavicon',
POCKET_ENABLED: 'extensions.pocket.enabled'
POCKET_ENABLED: 'extensions.pocket.enabled',
VIMIUM_ENABLED: 'extensions.vimium.enabled'
}

module.exports = settings
13 changes: 13 additions & 0 deletions test/about/extensionsTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,19 @@ describe('about:extensions', function () {
.url(pocketURL)
})
})
describe('Vimium', 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.VIMIUM_ENABLED, true)
.tabByIndex(0)
.waitForVisible('[data-extension-id="dbepggeogbaibhgnhhndojpepiihcmeb"]', extensionDownloadWaitTime)
})
})
describe('1Password', function () {
Brave.beforeAll(this)
before(function * () {
Expand Down

1 comment on commit ce004b9

@bbondy
Copy link
Member Author

@bbondy bbondy commented on ce004b9 Mar 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.