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
05bda694
Verified
Commit
05bda694
authored
Mar 28, 2024
by
Pier Angelo Vendrame
Browse files
Options
Downloads
Patches
Plain Diff
fixup! Bug 27476: Implement about:torconnect captive portal within Tor Browser
Formatted comments.
parent
8d41f191
No related branches found
No related tags found
1 merge request
!968
Draft: Bug 42479: Improve TorConnect error handling
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
toolkit/components/torconnect/TorConnectParent.sys.mjs
+12
-12
12 additions, 12 deletions
toolkit/components/torconnect/TorConnectParent.sys.mjs
with
12 additions
and
12 deletions
toolkit/components/torconnect/TorConnectParent.sys.mjs
+
12
−
12
View file @
05bda694
...
...
@@ -59,26 +59,25 @@ export class TorConnectParent extends JSWindowActorParent {
this
.
state
.
QuickStartEnabled
=
false
;
}
// JSWindowActiveParent derived objects cannot observe directly, so create a
member
// object to do our observing for us
// JSWindowActiveParent derived objects cannot observe directly, so create a
//
member
object to do our observing for us
.
//
// This object converts the various lifecycle events from the TorConnect
module, and
// maintains a state object which we pass down to our
about:torconnect page, which uses
// the state object to update its UI
// This object converts the various lifecycle events from the TorConnect
//
module, and
maintains a state object which we pass down to our
//
about:torconnect page, which uses
the state object to update its UI
.
this
.
torConnectObserver
=
{
observe
(
aSubject
,
aTopic
,
aData
)
{
let
obj
=
aSubject
?.
wrappedJSObject
;
//
u
pdate our state struct based on received torconnect topics and
forward on
// to aboutTorConnect.js
//
U
pdate our state struct based on received torconnect topics and
//
forward on
to aboutTorConnect.js
.
self
.
state
.
StateChanged
=
false
;
switch
(
aTopic
)
{
case
TorConnectTopics
.
StateChange
:
{
self
.
state
.
PreviousState
=
self
.
state
.
State
;
self
.
state
.
State
=
obj
.
state
;
self
.
state
.
StateChanged
=
true
;
// clear any previous error information if we are bootstrapping
// Clear any previous error information if we are bootstrapping.
if
(
self
.
state
.
State
===
TorConnectState
.
Bootstrapping
)
{
self
.
state
.
ErrorMessage
=
null
;
self
.
state
.
ErrorDetails
=
null
;
...
...
@@ -134,7 +133,7 @@ export class TorConnectParent extends JSWindowActorParent {
},
};
//
o
bserve all of the torconnect:.* topics
//
O
bserve all of the torconnect:.* topics
.
for
(
const
key
in
TorConnectTopics
)
{
const
topic
=
TorConnectTopics
[
key
];
Services
.
obs
.
addObserver
(
this
.
torConnectObserver
,
topic
);
...
...
@@ -158,7 +157,7 @@ export class TorConnectParent extends JSWindowActorParent {
}
willDestroy
()
{
//
s
top observing all of our torconnect:.* topics
//
S
top observing all of our torconnect:.* topics
.
for
(
const
key
in
TorConnectTopics
)
{
const
topic
=
TorConnectTopics
[
key
];
Services
.
obs
.
removeObserver
(
this
.
torConnectObserver
,
topic
);
...
...
@@ -213,7 +212,8 @@ export class TorConnectParent extends JSWindowActorParent {
Services
.
obs
.
notifyObservers
(
message
.
data
,
BroadcastTopic
);
break
;
case
"
torconnect:get-init-args
"
:
// called on AboutTorConnect.init(), pass down all state data it needs to init
// Called on AboutTorConnect.init(), pass down all state data it needs
// to init.
// pretend this is a state transition on init
// so we always get fresh UI
...
...
...
...
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