2

This link responds an mp3 file and can download by wget(1) also that downloaded local file can play by Firefox, but Firefox can't play it use URL, instead of Firefox prompts me to download its URL.
I find out one solution but not work in my case.
My media.play-stand-alone is true, I no find out any usage of media.directshow.enabled so I no try it.

I run on Debian Stretch, my Firefox version is Mozilla Firefox 60.2.0
Debian package information:

$ aptitude  show firefox-esr
Package: firefox-esr                     
Version: 60.2.2esr-1~deb9u1
State: installed (60.2.0esr-1~deb9u2), upgrade available (60.2.2esr-1~deb9u1)
Automatically installed: no
Priority: optional
Section: web
Maintainer: Maintainers of Mozilla-related packages <team+pkg-mozilla@tracker.debian.org>
Architecture: i386
Uncompressed Size: 173 M
Depends: libasound2 (>= 1.0.16), libatk1.0-0 (>= 1.12.4), libc6 (>= 2.18), libcairo-gobject2 (>= 1.10.0), libcairo2 (>= 1.10.0), libdbus-1-3 (>= 1.9.14), libdbus-glib-1-2 (>=
         0.78), libevent-2.0-5 (>= 2.0.10-stable), libffi6 (>= 3.0.4), libfontconfig1 (>= 2.11), libfreetype6 (>= 2.2.1), libgcc1 (>= 1:4.2), libgdk-pixbuf2.0-0 (>= 2.22.0),
         libglib2.0-0 (>= 2.31.8), libgtk-3-0 (>= 3.0.0), libjsoncpp1 (>= 1.7.4), libpango-1.0-0 (>= 1.14.0), libstartup-notification0 (>= 0.8), libstdc++6 (>= 6), libvpx4 (>=
         1.6.0), libx11-6, libx11-xcb1, libxcb-shm0, libxcb1, libxcomposite1 (>= 1:0.3-1), libxdamage1 (>= 1:1.1), libxext6, libxfixes3, libxrender1, libxt6, zlib1g (>=
         1:1.2.3.4), fontconfig, procps, debianutils (>= 1.16)
Recommends: libavcodec58 | libavcodec-extra58 | libavcodec57 | libavcodec-extra57 | libavcodec56 | libavcodec-extra56 | libavcodec55 | libavcodec-extra55 | libavcodec54 |
            libavcodec-extra54 | libavcodec53 | libavcodec-extra53
Suggests: fonts-stix | otf-stix, fonts-lmodern, libgssapi-krb5-2 | libkrb53, libcanberra0, libgtk2.0-0, pulseaudio
Conflicts: iceweasel (< 45)
Breaks: xul-ext-torbutton
Provides: gnome-www-browser, www-browser
Description: Mozilla Firefox web browser - Extended Support Release (ESR)
 Firefox ESR is a powerful, extensible web browser with support for modern web application technologies.
Tags: interface::x11, role::program, uitoolkit::gtk, web::browser
3

The problem here is that the server responds with a request header Content-Disposition: attachment that tells your browser to offer a download dialog instead of showing/playing the file inline.

$ curl -I 'https://fanyi.baidu.com/gettts?lan=en&text=A%20cross%20platform%20clipboard%20operation%20library%20of%20Python&spd=3&source=web'
HTTP/1.1 200 OK
Cache-Control: max-age=3600
Content-Disposition: attachment; filename=tts.mp3
Content-Length: 9576
Content-Type: audio/mpeg
…

See the documentation for this header at MDN for more information.

In a regular HTTP response, the Content-Disposition response header is a header indicating if the content is expected to be displayed inline in the browser, that is, as a Web page or as part of a Web page, or as an attachment, that is downloaded and saved locally.

Now your question essentially is How to ignore the Content-Disposition header? which has been previously asked on Stack Overflow, with several recommendations, including the Open in Browser extension.

Have you ever been annoyed when you wanted to see a document and the download popup appears which forces you to select an external application to view it?

This extension allows you to open the document directly in your browser.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.