在 Firefox 中使用 window.open 打开 WMV 文件;如何防止文件下载后打开或关闭空白窗口?
当您在CNET.com上下载文件时,页面上会显示一条消息,请稍等片刻,然后开始下载;如果没有,请单击链接。这与我正在使用的页面非常相似。
用户单击链接,就会出现此页面,其中包含与 CNET 类似的消息。唯一的区别是该文件是 WMV 文件,它会自动打开并播放。它在 IE 中运行良好。它在 Firefox 中无法正常工作。在 Firefox 中,如果用户进入“工具”->“选项”->“应用程序”,并为 Windows Media 视频文件选择“使用 Windows Media Player”,它将在外部 WMP 中播放。但是,如果用户使用 WMP 插件,页面会打开一个空白窗口,然后播放外部 WMP 中的视频。
window.open("test.wmv");
有没有办法阻止它打开窗口,或者如何在下载并播放 wmv 后关闭窗口?
非常感谢。
更新
我找到了一个链接,此处,可能与此问题相关。它指出,空白窗口是 Firefox 处理 WMP 插件(与 ASX 文件有关)方式的错误。该链接和我的问题之间的唯一区别是一个文件的类型为 WMV,另一个文件的类型为 ASX。该链接的日期为 2007 年,并且该问题是在 Firefox 1.5 上报告的,但也许它仍然有其优点。也许 Mozilla 从未解决过这个错误(仅供参考:我使用的是 Firefox 9.0.1)。
我开始认为没有直接的解决方案。我可以放一个免责声明,通知用户关闭Firefox中的WMP插件。模态窗口或 iFrame 有帮助吗?
When you download a file on CNET.com, a message will display on the page to wait a moment and the download will start; if it doesn't, click the link. That's very similar to the page with which I'm working.
The user clicks a link and this page appears with a similar message to CNETs. The only difference is the file is a WMV file and it automatically opens and plays. It works fine in IE. It's not working correctly in Firefox. In Firefox, if the user goes Tools->Options->Applications and selects "Use Windows Media Player" for Windows Media Video File, it plays in the external WMP. If the user uses the WMP plugin, however, the page opens up a blank window and then plays the video in the external WMP.
window.open("test.wmv");
Is there a way to prevent it from opening a window or how can I close the window after the wmv is downloaded and played?
Thank you very much.
Update
I found a link, here, that may be related to this issue. It states that the blank window is a bug with how Firefox handles the WMP plugin, with respect to ASX files. The only difference between the link and my question is one file is of type WMV and the other is of type ASX. The link is dated 2007 and the problem is reported on Firefox 1.5, but perhaps it still has merit. Maybe Mozilla has not addressed this bug, ever (FYI: I'm using Firefox 9.0.1).
I'm starting to think there is no direct solution. I can put a disclaimer, inform the user to turn off the WMP plugin in Firefox. Would a modal window or iFrame be helpful?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论