-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Illegal filename #347
Comments
Since the last update of firefox (v127.0), firefox throws an illegal character error when downloading files, and so nothing is downloaded. I use another addon, it uses pagetitle for naming the file, but no error with the last update of firefox (https://addons.mozilla.org/en-US/firefox/addon/save-text-to-file/) ? |
save-text-to-file seems to use a native app to write data to the disk so it won't be affected by Firefox update. |
I have not install that local app. By default, files are saved in the download directory used by Firefox. If you wish to save them elsewhere, then you need the local app. |
Hmm |
I am also having this issue with the character | in the page title. It used to work completely fine before but now any page title with an illegal character does not work. |
Correction it is as @Djidam says, it only fails when there is a dot and a space in the name! How odd! |
Link to the dot and space bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1903780 |
@eight04 isn't there some way you can make your users vote on the report at bugzilla, like put a message on the addon page or something so it gets prioritized? I don't think the single vote that I added would make a difference... |
If someone wants a workaround, a simple userscript can do the job with one line of code. Here is what I am using:
|
Hi, I tried your script with tampermonkey, it doesn't work for me. Maybe I'm missing something ? I finally opted for a portable version 126 of firefox (had troubles with chrome) and it does the job. |
@Djidam Well it works for my needs. I did update it a bit:
Replace |
Until the issue is fixed, perhaps we could add an option that strips all special characters from the pageTitle? Even apart from the bug it could be useful if you want to remove any potentially illegal characters from the path in case you want to set up a further pipeline that runs on the computer after the download. |
Yeah, it does seem that the Firefox developers don't really have any input from extension API devs when making changes in their internal functions especially when they are shared with them. The bug discussion has now gone to figuring out how or to even make provision for the extension API's specific needs. They make it sound as if the extension developers were using it wrongly after they themselves changed the scope of the problematic internal function. It is eerily similar to the blame games I experience among developers when they are caught being irresponsible. |
@eight04 Can you please mention in the bugzilla thread for dot and space bug, what you want from the download.sanitize API. The developer thinks that you only want directory validation and not file validation. Quite an odd understanding in my opinion. I think that you want complete path validation including the directory and filename. |
It is possible to do something like
Since %, spaces and dots are usually valid characters, I'm still not sure if we should escape them by default. |
@brazenvoid I think they are going to the right direction. They will need 2 API, one for validating filename and one for folder name. Now we only have one API. It is used to validate both filename and folder name. After ff127, it gets more strict to file extensions by disallowing spaces. While it makes no sense to folder name since there is no extension. It seems that they want to create a new option in the API to support both cases. |
Another case that may also lead to an invalid filename: |
https://bugzilla.mozilla.org/show_bug.cgi?id=1898498
Should we create a test to find all illegal characters?
The text was updated successfully, but these errors were encountered: