Open Bug 1903780 Opened 16 days ago Updated 4 days ago

downloads.download throws if the folder name contains a dot and a space

Categories

(WebExtensions :: Untriaged, defect)

Firefox 129
defect

Tracking

(firefox-esr115 affected, firefox127 wontfix, firefox128 affected, firefox129 affected)

Tracking Status
firefox-esr115 --- affected
firefox127 --- wontfix
firefox128 --- affected
firefox129 --- affected

People

(Reporter: eight04, Unassigned, NeedInfo)

References

Details

(Keywords: regression)

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:129.0) Gecko/20100101 Firefox/129.0

Steps to reproduce:

  1. Download and install the extension: https://github.com/eight04/webextension-test/archive/refs/heads/illegal-filename-2.zip
  2. Click the extension button to trigger browserAction.
  3. Inspect the background page and open the console.

Actual results:

Two errors are thrown:

Error: filename must not contain illegal characters

Expected results:

Two files are downloaded correctly with FF126 and Edge.

Reported by https://github.com/eight04/image-picka/issues/347#issuecomment-2173368486

The Bugbug bot thinks this bug should belong to the 'WebExtensions::Untriaged' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Product: Firefox → WebExtensions
Summary: downloads.download throws if the folder contains a dot and a space → downloads.download throws if the folder name contains a dot and a space

I guess this is because we're intending to replace the space with _ in the file extension after bug 1891234. Neil, does that sound right? Can we refine the replacement so it doesn't affect the case reported here? (looks like it's a filename that contains . followed by somewhere, before the final .jpg)

Flags: needinfo?(enndeakin)

I am not able to see any errors in consoles in FF 127 and 129, but also the files expected to be downloaded are not present.

Can you please attach a video or a screenshot with the errors?

Flags: needinfo?(eight04)
Attached video 2024-06-25 21-55-34.mkv

I started the browser via web-ext. Does it affect logging?

Flags: needinfo?(eight04)

Hello,

I reproduced the issue on the latest Nightly (129.0a1/20240625213230), Beta (128.0b7/20240624113619) and Release (127.0.2/20240624183754) under Windows 10 x64 and Ubuntu 22.04 LTS.

Clicking the extension button will throw two errors as mentioned in Comment 0 and the files are not downloaded. See the attached screenshots for more details.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached image 2024-06-26_09h37_57.png
See Also: → 1898498
Keywords: regression

:robwu do you plan on making a similar fix as in Bug 1898498?
:zombie could this be triaged for severity?

Flags: needinfo?(tomica)
Flags: needinfo?(rob)

I'm not planning to do the same fix as bug 1898498, because I don't think that we should disallow directories in the format blabla<dot><space>something.

I think that we need to use a different mechanism to verify whether an input is an acceptable directory name, because DownloadPaths.sanitize is now too strict.

Flags: needinfo?(rob)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: