我想使用 WebExtensions 创建一个 Firefox 插件,这样就可以了;
- 显示用户、已创建的 Firefox 配置文件列表
- 能够切换个人资料
就像用户代理切换器(它构建在 Mozilla Addon SDK 之上)。观看https://www.screencast.com/t/Zj4AkTmFfA
我无法找到 https://developer.mozilla.org/en-US/Add-ons/WebExtensions 上的任何 api 引用访问配置文件列表或切换配置文件。
不确定 Mozilla 是否会从 WebExtensions 中删除对 Firefox 配置文件的访问,就像它们限制对 Firefox 首选项的访问一样 (about:config)。
最佳答案
恐怕目前没有 API 来处理用户配置文件。除了 MDN 上的列表之外,还有一个 list of APIs已获批准并正在实现。
但是,有一种中期可能性:您可以提交错误来请求对新 API 的支持。这并不一定意味着您的请求将被实现,但它确实意味着它至少会被讨论。有指南here关于如何做到这一点。
If none of these options address your situation, you can consider filing an API request. Before you do, please keep in mind:
- The goal of WebExtensions is not to support every use case from legacy extensions. In most cases, the functionality you need can be
built with WebExtensions APIs, but it requires some re-thinking and
modification.- Generic or very broad bugs are hard to turn into actionable issues. Try to limit the focus if possible.
- We do try to review all incoming API requests, but it takes time, so please be patient.
- Do a search to see if the bug exists already.
- Still want to file a new API? You can do so here.
请注意,有ideas对于 Firefox 57 后的文件系统访问:这可能至少用于显示不同的用户配置文件。
关于firefox - Mozilla WebExtensions 对 Firefox 配置文件的支持,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45179115/