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
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Applications
Tor Browser
Commits
18be328e
Verified
Commit
18be328e
authored
6 months ago
by
ma1
Browse files
Options
Downloads
Patches
Plain Diff
fixup! Bug 42835: Create an actor to filter file data transfers
Bug 43064: Make file filtering more specific
parent
ded2e90d
No related branches found
Branches containing commit
Tags
base-browser-115.15.0esr-13.5-1-build2
No related merge requests found
Pipeline
#196676
failed
6 months ago
Stage: lint
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
toolkit/actors/FilesFilterChild.sys.mjs
+6
-3
6 additions, 3 deletions
toolkit/actors/FilesFilterChild.sys.mjs
with
6 additions
and
3 deletions
toolkit/actors/FilesFilterChild.sys.mjs
+
6
−
3
View file @
18be328e
...
...
@@ -12,11 +12,14 @@ ChromeUtils.defineLazyGetter(lazy, "console", () => {
export
class
FilesFilterChild
extends
JSWindowActorChild
{
handleEvent
(
event
)
{
if
(
!
Services
.
prefs
.
getBoolPref
(
"
browser.filesfilter.enabled
"
,
true
))
{
return
;
}
// drop or paste
const
{
composedTarget
}
=
event
;
const
dt
=
event
.
clipboardData
||
event
.
dataTransfer
;
if
(
dt
.
files
.
leng
th
)
{
if
(
[...
dt
.
files
].
some
(
f
=>
f
.
mozFullPa
th
)
)
{
if
(
[
"
HTMLInputElement
"
,
"
HTMLTextAreaElement
"
].
includes
(
ChromeUtils
.
getClassName
(
composedTarget
)
...
...
@@ -25,7 +28,7 @@ export class FilesFilterChild extends JSWindowActorChild {
event
.
preventDefault
();
lazy
.
console
.
log
(
`Preventing path leak on
${
event
.
type
}
for
${[...
dt
.
files
]
.
map
(
f
=>
f
.
name
)
.
map
(
f
=>
`
${
f
.
name
}
(
${
f
.
mozFullPath
}
)`
)
.
join
(
"
,
"
)}
.`
);
}
...
...
@@ -33,7 +36,7 @@ export class FilesFilterChild extends JSWindowActorChild {
}
// "Paste Without Formatting" (ctrl+shift+V) in HTML editors coerces files into paths
if
(
!
(
event
.
clipboardData
&&
dt
.
getData
(
"
text
"
)))
{
if
(
!
(
event
.
clipboardData
&&
/
[\/\\]
/
.
test
(
dt
.
getData
(
"
text
"
)))
)
{
return
;
}
...
...
This diff is collapsed.
Click to expand it.
ma1
@ma1
mentioned in merge request
!1111 (merged)
·
6 months ago
mentioned in merge request
!1111 (merged)
mentioned in merge request !1111
Toggle commit list
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