在书签菜单中添加上下文菜单 [英] Add context menu in bookmark menu

查看:145
本文介绍了在书签菜单中添加上下文菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Firefox的书签菜单(使用WebExtension)中添加一个上下文菜单项。我阅读了 contextMenus.create()文章和例子适用于我。



有一堆上下文类型,但似乎没有在书签菜单中工作。这是不可能的?

解决方案

WebExtension目前不可能。一般来说,如果您在WebExtensions中尚不存在您所需的功能,您可以:


  • 提出请求增强(一个错误)请求功能。在将项目添加到书签上下文菜单的情况下,这样的错误已经存在: Bug 1370499:考虑支持书签上下文菜单。从这个跟踪错误的一般方向是,在书签上下文菜单中添加一个条目将在某个时间点执行。

  • 创建一个 WebExtension实验:您可以创建一个WebExtension实验来实现该功能。如果您创建了WebExtension实验,则可以请求将其集成到Firefox中(可能发生,也可能不会发生)。进行WebExtension实验会使您更有可能实现您想要的内容,因为这样可以减少Mozilla开发人员所需的时间。由于WebExtension实验实际上是传统的附加组件,因此从Firefox 57(2017-11-14)的发布版本开始,它们将无法在Firefox中正常运行。



    在Firefox Nightly中,WebExtension实验支持(通常为旧版附加组件)在默认情况下处于禁用状态。但是,在Nightly中,您可以启用 about:config 首选项, extensions.legacy.enabled ,这可以让您使用旧版扩展,包括WebExtension实验。开发人员版本中预计也是如此,但尚未得到验证。 WebExtension实验和传统加载项在Firefox 57的发布版本中肯定不能运行。 可能会提高向Firefox添加某些功能的机会,即查看Chrome扩展程序中的可能性。如果您的 Chrome扩展程序API 与您的要求非常匹配,那么Mozilla更可能将会执行它。



    不幸的是,其他类型的扩展中有大量的功能可用,这在WebExtensions中是不可能的目前最少,几乎所有的都是永久性的),但是可以实现任何特定的功能。一些最初不被支持的东西至少在一定程度上被实现了(例如 Sidebar )。


    I am trying to add a context menu item in the bookmark menu of Firefox (with a WebExtension). I read the contextMenus.create() article and the example works for me.

    There are a bunch of context types, but none seems to work in the bookmark menu. Is this not possible?

    解决方案

    What you desire is not currently possible in a WebExtension. In general, if there is capability that you desire in WebExtensions which does not already exist, you can:

    • File a Request For Enhancement (a bug) requesting the functionality. In the case of adding an item to the bookmark context menu, such a bug already exists: Bug 1370499: Consider support for bookmark context menus. The general direction from this tracking bug is that adding an entry to the bookmark context menu will be implemented at some point in time.

    • Create a WebExtension experiment: You can create a WebExtension experiment to implement the functionality. If you create a WebExtension experiment, you can request that it be integrated into Firefox (which may, or may not happen). Having a WebExtension experiment will make it more likely that something along the lines of what you want is implemented, because it reduces the amount of Mozilla developer time required to do so. As WebExtension Experiments are actually legacy add-ons, they will not be able to function in Firefox as of the Release version of Firefox 57 (2017-11-14).

      WebExtension experiments support (and legacy add-ons in general) is disabled by default in Firefox Nightly. However, in Nightly, you can enable an about:config preference, extensions.legacy.enabled, which allows you to use legacy extensions, including WebExtension Experiments. This is expected to be also be true in Developer Edition, but has not been verified. WebExtension Experiments and legacy add-ons certainly won't function in the Release version of Firefox 57.

    One thing that might improve the chance of having some functionality added to Firefox is to look through what is possible in Chrome extensions. If there is a Chrome extension API which closely matches what you desire, then it's more likely that Mozilla will implement it.

    Unfortunately, there is a huge amount of functionality available in the other types of extensions which is not possible in WebExtensions (at least currently, and almost all of it permanently), but it's possible that any specific functionality could implemented. Some things not initially supported have been implemented, at least to a limited extent (e.g. Sidebars).

    这篇关于在书签菜单中添加上下文菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆