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
8dfafdd5
Commit
8dfafdd5
authored
Nov 10, 2022
by
ma1
Committed by
Pier Angelo Vendrame
Mar 12, 2024
Browse files
Options
Downloads
Patches
Plain Diff
Bug 41434: Letterboxing, improve logging.
parent
be0bf9fb
No related branches found
No related tags found
1 merge request
!940
Bug 42448: Rebase Tor Browser stable onto Firefox 115.9.0esr
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
toolkit/components/resistfingerprinting/RFPHelper.sys.mjs
+11
-50
11 additions, 50 deletions
toolkit/components/resistfingerprinting/RFPHelper.sys.mjs
with
11 additions
and
50 deletions
toolkit/components/resistfingerprinting/RFPHelper.sys.mjs
+
11
−
50
View file @
8dfafdd5
...
...
@@ -415,8 +415,8 @@ class _RFPHelper {
* content viewport.
*/
async
_roundContentView
(
aBrowser
,
isNewTab
=
false
)
{
let
log
Id
=
Math
.
random
();
log
(
"
_roundContentView[
"
+
logId
+
"
]
"
);
let
log
Prefix
=
`_roundContentView[
${
Math
.
random
()
}
]`
;
log
(
logPrefix
);
aBrowser
.
classList
.
remove
(
"
exclude-letterboxing
"
);
let
win
=
aBrowser
.
ownerGlobal
;
let
browserContainer
=
aBrowser
...
...
@@ -435,17 +435,9 @@ class _RFPHelper {
);
log
(
"
_roundContentView[
"
+
logId
+
"
] contentWidth=
"
+
contentWidth
+
"
contentHeight=
"
+
contentHeight
+
"
containerWidth=
"
+
containerWidth
+
"
containerHeight=
"
+
containerHeight
+
"
"
`
${
logPrefix
}
contentWidth=
${
contentWidth
}
contentHeight=
${
contentHeight
}
parentWidth=
${
parentWidth
}
parentHeight=
${
parentHeight
}
containerWidth=
${
containerWidth
}
containerHeight=
${
containerHeight
}${
isNewTab
?
"
(new tab).
"
:
"
.
"
}
`
);
if
(
containerWidth
===
0
)
{
...
...
@@ -455,16 +447,7 @@ class _RFPHelper {
const
calcMargins
=
(
aWidth
,
aHeight
)
=>
{
let
result
;
log
(
"
_roundContentView[
"
+
logId
+
"
] calcMargins(
"
+
aWidth
+
"
,
"
+
aHeight
+
"
)
"
);
log
(
`
${
logPrefix
}
calcMargins(
${
aWidth
}
,
${
aHeight
}
)`
);
// If the set is empty, we will round the content with the default
// stepping size.
if
(
!
this
.
_letterboxingDimensions
.
length
)
{
...
...
@@ -473,16 +456,7 @@ class _RFPHelper {
height
:
this
.
steppedRange
(
aHeight
),
};
log
(
"
_roundContentView[
"
+
logId
+
"
] calcMargins(
"
+
aWidth
+
"
,
"
+
aHeight
+
"
) =
"
+
result
.
width
+
"
x
"
+
result
.
height
`
${
logPrefix
}
calcMargins(
${
aWidth
}
,
${
aHeight
}
) =
${
result
.
width
}
x
${
result
.
height
}
`
);
return
result
;
}
...
...
@@ -523,16 +497,7 @@ class _RFPHelper {
}
log
(
"
_roundContentView[
"
+
logId
+
"
] calcMargins(
"
+
aWidth
+
"
,
"
+
aHeight
+
"
) =
"
+
result
.
width
+
"
x
"
+
result
.
height
`
${
logPrefix
}
calcMargins(
${
aWidth
}
,
${
aHeight
}
) =
${
result
.
width
}
x
${
result
.
height
}
`
);
return
result
;
};
...
...
@@ -588,12 +553,10 @@ class _RFPHelper {
// If the size of the content is already quantized, we do nothing.
if
(
!
marginChanges
.
length
)
{
log
(
"
_roundContentView[
"
+
logId
+
"
]
is_rounded == true
"
);
log
(
`
${
logPrefix
}
is_rounded == true
`
);
if
(
this
.
_isLetterboxingTesting
)
{
log
(
"
_roundContentView[
"
+
logId
+
"
] is_rounded == true test:letterboxing:update-margin-finish
"
`
${
logPrefix
}
is_rounded == true test:letterboxing:update-margin-finish`
);
Services
.
obs
.
notifyObservers
(
null
,
...
...
@@ -603,9 +566,7 @@ class _RFPHelper {
return
;
}
log
(
"
_roundContentView[
"
+
logId
+
"
] setting margins to
"
+
marginStyleString
);
log
(
`
${
logPrefix
}
setting margins to
${
marginStyleString
}
`
);
// One cannot (easily) control the color of a margin unfortunately.
// An initial attempt to use a border instead of a margin resulted
// in offset event dispatching; so for now we use a colorless margin.
...
...
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
register
or
sign in
to comment