How can I get the browser to prompt for duplicate file downloads?

Firefox

Open Firefox settings, and search for save, and choose "Always ask you where to save files".

Now, if you try to save another file with the same name, the browser asks you if you want to replace the existing (duplicate) file.

Then you can save with a different name, or Cancel the download.

Chromium

Chromium asks you where to save, and tells you if there is a duplicate.

enter image description here