Trigger download in firefox without creating history entry

I want to trigger a download from a website using window.location or other similar means while not adding a history entry. In Chrome, using window.location.replace() works and doesn’t append the history, but on Firefox, any method I’ve tried did. The URL for the download contains a token, which I’d prefer not to have stored in the browsers history.

Here are the methods I’ve tried so far, but all created a history entry:

  • window.location.replace()
  • create an tag and click it
  • create an iframe with the url set to the download location
  • use window.location and history.replaceState – only appends another entry

Are there any other options that I could try here? Note that the download path and frontend code are hosted on the same domain, so it’s not a domain mismatch