在 Firefox 扩展中嵌入 SWF 文件
我正在开发 Chrome、Safari 和 Firefox 的扩展程序,我需要在扩展程序中添加 SWF 文件。我想在页面上显示它。我在文档中读到我可以在 Chrome 和 Safari 扩展程序中存储媒体文件。
我可以用 Firefox 做同样的事情吗?
I'm developing extensions for Chrome, Safari and Firefox, and I need to add SWF file in my extension. I want to show it on a page. I read in documentation that I can store media files in Chrome and Safari extension.
Can I do the same with Firefox?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,Firefox 扩展还可以包含您喜欢的任何文件。但您可能想问:“我可以在扩展程序中获取可在网页上使用的文件的 URL 吗?”如果您使用附加 SDK 那么它很简单
:附加组件稍微复杂一些 - 出于安全原因,网页通常无法使用
chrome://
URL。不过,您可以在 为您的命名空间指定contentaccessible
标志 code>chrome.manifest,例如:那么网页将能够使用
chrome://myextension/content/file.swf
。另一种选择是注册resource://
命名空间,这些始终可以从网页访问。Yes, a Firefox extension can also contain any files you like. But you probably meant to ask: "Can I get a URL of a file in my extension that will be usable on a web page?" If you are using the Add-on SDK then it is simply:
In a classic add-on it is slightly more complicated -
chrome://
URLs normally cannot be used by web pages, for security reasons. You can however specify thecontentaccessible
flag for your namespace inchrome.manifest
, e.g.:Then web pages will be able to use
chrome://myextension/content/file.swf
. The other option would be to register aresource://
namespace, these are always accessible from web pages.