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

Commit ca30824

Browse files
diracdeltasbsclifton
authored andcommitted
disable URLbar context menu while tor is initializing
fix #14525 Test Plan: 1. start brave 2. immediately open a tor tab 3. while Tor is still connecting, try to right-click in the urlbar 4. you should not see any context menu popup
1 parent 91f048b commit ca30824

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

app/renderer/components/navigation/urlBar.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,9 @@ class UrlBar extends React.Component {
462462
}
463463

464464
onContextMenu (e) {
465+
if (this.torInitializing) {
466+
return
467+
}
465468
contextMenus.onUrlBarContextMenu(e)
466469
}
467470

@@ -553,10 +556,16 @@ class UrlBar extends React.Component {
553556
return <span className='evCert' title={this.props.evCert}> {this.props.evCert} </span>
554557
}
555558

559+
get torInitializing () {
560+
// Returns true if the current tab is a Tor tab and Tor has not yet
561+
// initialized successfully
562+
return this.props.isTor &&
563+
(this.props.torPercentInitialized || this.props.torInitializationError !== false)
564+
}
565+
556566
get shouldDisable () {
557567
return (this.props.displayURL === undefined && this.loadTime === '') ||
558-
(this.props.isTor &&
559-
(this.props.torPercentInitialized || this.props.torInitializationError !== false))
568+
this.torInitializing
560569
}
561570

562571
setUrlBarRef (ref) {

0 commit comments

Comments
 (0)