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
a24543de
Commit
a24543de
authored
5 months ago
by
henry
Committed by
Pier Angelo Vendrame
5 months ago
Browse files
Options
Downloads
Patches
Plain Diff
fixup! TB 7494: Create local home page for TBB.
This reverts commit
2780d106
.
parent
a36c8040
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!1502
TB 43415 (part 2): Cherry-picks from 128.9.0esr
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
browser/components/abouttor/content/aboutTor.js
+9
-49
9 additions, 49 deletions
browser/components/abouttor/content/aboutTor.js
with
9 additions
and
49 deletions
browser/components/abouttor/content/aboutTor.js
+
9
−
49
View file @
a24543de
...
...
@@ -182,21 +182,6 @@ const SurveyArea = {
*/
_version
:
1
,
/**
* The latest version of the survey the user has dismissed.
* If higher or equal than _version, the survey will not be displayed.
*
* @type {integer}
*/
_dismissVersion
:
0
,
/**
* The surveys will be shown only in the stable channel of Tor Browser.
*
* @type {boolean}
*/
_isStable
:
false
,
/**
* The date to start showing the survey.
*
...
...
@@ -308,13 +293,6 @@ const SurveyArea = {
},
],
/**
* The observer to update the localized content whenever the language changes.
*
* @type {MutationObserver}
*/
_langObserver
:
null
,
/**
* Initialize the survey area.
*/
...
...
@@ -333,17 +311,6 @@ const SurveyArea = {
document
.
getElementById
(
"
survey-dismiss
"
).
addEventListener
(
"
click
"
,
()
=>
{
this
.
_hide
();
});
this
.
_langObserver
=
new
MutationObserver
(
mutationList
=>
{
for
(
const
mutation
of
mutationList
)
{
if
(
mutation
.
type
===
"
attributes
"
&&
mutation
.
attributeName
===
"
lang
"
)
{
this
.
potentiallyShow
();
}
}
});
this
.
_langObserver
.
observe
(
document
.
documentElement
,
{
attributes
:
true
});
},
/**
...
...
@@ -366,33 +333,23 @@ const SurveyArea = {
},
/**
*
Set the data for
the survey.
*
Decide whether to show
the survey.
*
* @param {integer} dismissVersion - The latest version of survey that the
* user has already dismissed.
* @param {boolean} isStable - Whether this is the stable release of Tor
* Browser.
*/
setData
(
dismissVersion
,
isStable
)
{
this
.
_isStable
=
isStable
;
this
.
_dismissVersion
=
dismissVersion
;
this
.
potentiallyShow
();
},
/**
* Decide whether to show or update the survey.
*/
potentiallyShow
()
{
potentiallyShow
(
dismissVersion
,
isStable
)
{
const
now
=
Date
.
now
();
if
(
now
<
this
.
_startDate
||
now
>=
this
.
_endDate
||
// The user has already dismissed this version of the survey before:
this
.
_
dismissVersion
>=
this
.
_version
||
!
this
.
_
isStable
dismissVersion
>=
this
.
_version
||
!
isStable
)
{
// Don't show the survey.
document
.
body
.
classList
.
remove
(
"
show-survey
"
);
return
;
}
...
...
@@ -401,7 +358,6 @@ const SurveyArea = {
// Instead we only translate the banner into a limited set of locales that
// match the languages that the survey itself supports. This should match
// the language of the survey when it is opened by the user.
this
.
_localeData
=
this
.
_localeDataSet
[
0
];
const
pageLocale
=
document
.
documentElement
.
getAttribute
(
"
lang
"
);
for
(
const
localeData
of
this
.
_localeDataSet
)
{
if
(
localeData
.
browserLocales
.
includes
(
pageLocale
))
{
...
...
@@ -409,6 +365,10 @@ const SurveyArea = {
break
;
}
}
if
(
!
this
.
_localeData
)
{
// Show the default en-US banner.
this
.
_localeData
=
this
.
_localeDataSet
[
0
];
}
// Make sure the survey's lang and dir attributes match the chosen locale.
const
surveyEl
=
document
.
getElementById
(
"
survey
"
);
...
...
@@ -443,5 +403,5 @@ window.addEventListener("InitialData", event => {
}
=
event
.
detail
;
SearchWidget
.
setOnionizeState
(
!!
searchOnionize
);
MessageArea
.
setMessageData
(
messageData
,
!!
isStable
,
!!
torConnectEnabled
);
SurveyArea
.
setData
(
surveyDismissVersion
,
isStable
);
SurveyArea
.
potentiallyShow
(
surveyDismissVersion
,
isStable
);
});
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