hrdl-github / cookies-txt

A Firefox add-on which exports all cookies to a Netscape HTTP Cookie File
GNU General Public License v3.0
190 stars 23 forks source link

Replace slash characters in resulting file names #20

Closed vadcx closed 1 year ago

vadcx commented 1 year ago

On Firefox you can have arbitrarily named Containers and this extension supports separate export file per container. Naming scheme: "cookies.containerName.txt"

However when the container name contains a slash character, then the .download(...) function will automatically create a folder structure (unexpectedly).

For example, container name "Corp/Website" will ask the user to save that file in:

Strip all slashes to prevent this. Other characters seem to be handled safely by the browser (like .. double-dot).


The slashes will be replaced with the _ underscore.

EDIT: I have only tested this change in the JS console.