GithubHelp home page GithubHelp logo

Comments (7)

lgrahl avatar lgrahl commented on July 4, 2024 1

Found this so far: https://bugzilla.mozilla.org/show_bug.cgi?id=1759835

from threema-web.

lgrahl avatar lgrahl commented on July 4, 2024

Happens on a lot of pages, so I'm not even sure we should do anything about it. Agree it's annoying though. Maybe there's a bugzilla bug?

from threema-web.

threema-danilo avatar threema-danilo commented on July 4, 2024

A potential workaround is downloading PDF files using the media type application/octet-stream, one of our support staff said that this seems to help. It's a ugly hack for a problem in Firefox, but if it works it might be a valid workaround. Opening PDFs is probably quite a common use case for Threema Web, so this should not break (it logs you out of the current session).

I'll take a closer look this afternoon. We're using a method that should always result in a download, so I suspect that Firefox is doing something wrong here. If I can confirm that, I'll comment on the Bugzilla ticket.

from threema-web.

lgrahl avatar lgrahl commented on July 4, 2024

Found another longer discussion we might want to chime in: https://bugzilla.mozilla.org/show_bug.cgi?id=1756980#c5 (sigh, blaming bad UX while not even knowing the use case, like SPA with state in memory... come on)

We're using file-saver which uses target=_blank, so this would be the most fitting bug I guess: https://bugzilla.mozilla.org/show_bug.cgi?id=1759916

from threema-web.

threema-danilo avatar threema-danilo commented on July 4, 2024

Ugh, so they intentionally ignore the download attribute and Content-Disposition: attachment? https://bugzilla.mozilla.org/show_bug.cgi?id=1756980#c7

from threema-web.

threema-danilo avatar threema-danilo commented on July 4, 2024

We're using file-saver which uses target=_blank, so this would be the most fitting bug I guess: https://bugzilla.mozilla.org/show_bug.cgi?id=1759916

file-saver uses a lot of different approaches depending on the browser: https://github.com/eligrey/FileSaver.js/blob/master/src/FileSaver.js In our case (Firefox) an approach with a.href = URL.createObjectURL(blob) followed by click(a) is used.

Fun fact from bugzilla 1756980:

This also happens on WhatsApp web now. PDF files are opened in the same tab, although pressing the back button does re-logins the users. But I think this shows that this behavior is not expected.

For now, I'll add the ugly application/octet-stream workaround hack for Firefox, which does seem to work.

from threema-web.

dbrgn avatar dbrgn commented on July 4, 2024

For the record, the change was finally reverted in Firefox 103: https://bugzilla.mozilla.org/show_bug.cgi?id=1756980#c71

from threema-web.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.