Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor Browser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Applications
Tor Browser
Commits
94374ba5
Commit
94374ba5
authored
Apr 22, 2024
by
henry
Browse files
Options
Downloads
Patches
Plain Diff
fixup! Lox integration
Bug 42476: Disable the Lox module for the stable release.
parent
45f5e2d9
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!1003
Disable the Lox module for the release channel
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
toolkit/components/lox/Lox.sys.mjs
+29
-1
29 additions, 1 deletion
toolkit/components/lox/Lox.sys.mjs
with
29 additions
and
1 deletion
toolkit/components/lox/Lox.sys.mjs
+
29
−
1
View file @
94374ba5
import
{
XPCOMUtils
}
from
"
resource://gre/modules/XPCOMUtils.sys.mjs
"
;
import
{
AppConstants
}
from
"
resource://gre/modules/AppConstants.sys.mjs
"
;
import
{
clearInterval
,
setInterval
,
...
...
@@ -103,7 +104,24 @@ export class LoxError extends Error {
}
class
LoxImpl
{
/**
* Whether the Lox module has completed initialization.
*
* @type {boolean}
*/
#initialized
=
false
;
/**
* Whether the Lox module is enabled for this Tor Browser instance.
*
* @type {boolean}
*/
#enabled
=
AppConstants
.
MOZ_UPDATE_CHANNEL
!==
"
release
"
;
get
enabled
()
{
return
this
.
#enabled
;
}
#pubKeyPromise
=
null
;
#encTablePromise
=
null
;
#constantsPromise
=
null
;
...
...
@@ -217,13 +235,14 @@ class LoxImpl {
* Assert that the module is initialized.
*/
#assertInitialized
()
{
if
(
!
this
.
#initialized
)
{
if
(
!
this
.
enabled
||
!
this
.
#initialized
)
{
throw
new
LoxError
(
"
Not initialized
"
);
}
}
get
#inuse
()
{
return
(
this
.
enabled
&&
Boolean
(
this
.
#activeLoxId
)
&&
lazy
.
TorSettings
.
bridges
.
enabled
===
true
&&
lazy
.
TorSettings
.
bridges
.
source
===
lazy
.
TorBridgeSource
.
Lox
...
...
@@ -531,6 +550,12 @@ class LoxImpl {
}
async
init
()
{
if
(
!
this
.
enabled
)
{
lazy
.
logger
.
info
(
"
Skipping initialization since Lox module is not enabled
"
);
return
;
}
// If lox_id is set, load it
Services
.
obs
.
addObserver
(
this
,
lazy
.
TorSettingsTopics
.
SettingsChanged
);
Services
.
obs
.
addObserver
(
this
,
lazy
.
TorSettingsTopics
.
Ready
);
...
...
@@ -548,6 +573,9 @@ class LoxImpl {
}
async
uninit
()
{
if
(
!
this
.
enabled
)
{
return
;
}
Services
.
obs
.
removeObserver
(
this
,
lazy
.
TorSettingsTopics
.
SettingsChanged
);
Services
.
obs
.
removeObserver
(
this
,
lazy
.
TorSettingsTopics
.
Ready
);
if
(
this
.
#domainFrontedRequests
!==
null
)
{
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment