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

Commit

Permalink
Fix fingerprinting info click
Browse files Browse the repository at this point in the history
Auditors: @aekeus
  • Loading branch information
bbondy committed Jul 14, 2016
1 parent b7d1108 commit d82c6bf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
7 changes: 6 additions & 1 deletion js/components/braveryPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const React = require('react')
const ipc = require('electron').ipcRenderer
const Immutable = require('immutable')
const ImmutableComponent = require('./immutableComponent')
const config = require('../constants/config')
const Dialog = require('./dialog')
const SwitchControl = require('./switchControl')
const windowActions = require('../actions/windowActions')
Expand Down Expand Up @@ -33,6 +34,7 @@ class BraveryPanel extends ImmutableComponent {
this.onToggleFp = this.onToggleSiteSetting.bind(this, 'fingerprintingProtection')
this.onReload = this.onReload.bind(this)
this.onEditGlobal = this.onEditGlobal.bind(this)
this.onInfoClick = this.onInfoClick.bind(this)
}
get isBlockingTrackedContent () {
return this.blockedByTrackingList && this.blockedByTrackingList.size > 0
Expand Down Expand Up @@ -130,6 +132,9 @@ class BraveryPanel extends ImmutableComponent {
onEditGlobal () {
ipc.emit(messages.SHORTCUT_NEW_FRAME, {}, 'about:preferences#privacy')
}
onInfoClick () {
ipc.emit(messages.SHORTCUT_NEW_FRAME, {}, config.fingerprintingInfoUrl)
}
onToggleSiteSetting (setting, e) {
let ruleKey = siteUtil.getOrigin(this.props.activeRequestedLocation)
const parsedUrl = urlParse(this.props.activeRequestedLocation)
Expand Down Expand Up @@ -286,7 +291,7 @@ class BraveryPanel extends ImmutableComponent {
<option data-l10n-id='block3rdPartyCookie' value='block3rdPartyCookie' />
<option data-l10n-id='allowAllCookies' value='allowAllCookies' />
</select>
<SwitchControl onClick={this.onToggleFp} rightl10nId='fingerprintingProtection' checkedOn={fpEnabled} disabled={!shieldsUp} infoUrl='https://github.com/brave/browser-laptop/wiki/Fingerprinting-Protection-Mode' className='fingerprintingProtectionSwitch' />
<SwitchControl onClick={this.onToggleFp} rightl10nId='fingerprintingProtection' checkedOn={fpEnabled} disabled={!shieldsUp} onInfoClick={this.onInfoClick} className='fingerprintingProtectionSwitch' />
<SwitchControl onClick={this.onToggleSafeBrowsing} rightl10nId='safeBrowsing' checkedOn={this.props.braverySettings.safeBrowsing} disabled={!shieldsUp} />
</div>
</div></span>
Expand Down
6 changes: 3 additions & 3 deletions js/components/switchControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ class SwitchControl extends ImmutableComponent {
this.props.rightl10nId && this.props.topl10nId
? <div className='switchControlText'><div className='switchControlRightText'><div className='switchSpacer'>&nbsp;</div><span className='switchControlRightText' data-l10n-id={this.props.rightl10nId} /></div></div>
: <div className='switchControlRight'>
{this.props.rightl10nId && !this.props.infoUrl
{this.props.rightl10nId && !this.props.onInfoClick
? <span className='switchControlRightText' data-l10n-id={this.props.rightl10nId} />
: null}
{this.props.rightl10nId && this.props.infoUrl
? <div className='switchControlRightText'><span data-l10n-id={this.props.rightl10nId} /><span className='fa fa-question-circle info clickable' /></div>
{this.props.rightl10nId && this.props.onInfoClick
? <div className='switchControlRightText'><span data-l10n-id={this.props.rightl10nId} /><span className='fa fa-question-circle info clickable' onClick={this.props.onInfoClick} /></div>
: null}
</div>
}
Expand Down
1 change: 1 addition & 0 deletions js/constants/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = {
// Each zoomLevel is multiplied by 20 to get the percentage offset from 100. That's 0.05 per percentage offset.
zoomLevels: [-3.75, -3.35, -2.5, -1.65, -1.25, -0.5, -0.25, 0, 0.25, 0.5, 1.25, 2.5, 3.75, 5, 7.5, 10, 15, 20]
},
fingerprintingInfoUrl: 'https://github.com/brave/browser-laptop/wiki/Fingerprinting-Protection-Mode',
maxClosedFrames: 100,
thumbnail: {
width: 160,
Expand Down

0 comments on commit d82c6bf

Please sign in to comment.