如何让 Firefox 播放音频文件而不是提示我下载它?

ill*_*ate 2 linux firefox debian debian-stretch

该链接响应一个 mp3 文件,可以通过wget(1)下载,并且下载的本地文件可以通过 Firefox 播放,但 Firefox 无法使用URL播放它,而不是 Firefox 提示我下载其URL
我找到了一种解决方案,但不适用于我的情况。
我的media.play-stand-alonetrue,我没有找到任何用法,media.directshow.enabled所以我没有尝试。

我在Debian Stretch上运行,我的Firefox版本是Mozilla Firefox 60.2.0
Debian软件包信息:

$ 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
Run Code Online (Sandbox Code Playgroud)

Dan*_*eck 5

这里的问题是服务器响应一个请求标头Content-Disposition: attachment,告诉您的浏览器提供下载对话框而不是内联显示/播放文件。

\n
$ curl -I \'https://fanyi.baidu.com/gettts?lan=en&text=A%20cross%20platform%20clipboard%20operation%20library%20of%20Python&spd=3&source=web\'\nHTTP/1.1 200 OK\nCache-Control: max-age=3600\nContent-Disposition: attachment; filename=tts.mp3\nContent-Length: 9576\nContent-Type: audio/mpeg\n\xe2\x80\xa6\n
Run Code Online (Sandbox Code Playgroud)\n

有关详细信息,请参阅 MDN 上此标头的文档

\n
\n

在常规的 HTTP 响应中,Content-Disposition响应头是指示内容是否期望在浏览器中内联显示的标头,即作为网页或作为网页的一部分,或者作为附件即下载并显示在浏览器中。保存在本地。

\n
\n

现在您的问题本质上是如何忽略 Content-Disposition 标头? 之前曾在 Stack Overflow 上询问过,并提出了一些建议,包括在浏览器中打开扩展。

\n
\n

当您想要查看某个文档时,却出现下载弹出窗口,迫使您选择外部应用程序来查看它,您是否曾经感到恼火?

\n

此扩展允许您直接在浏览器中打开文档。

\n
\n