如何将按钮添加到工具栏和菜单顶部
How to add a button to toolbar, and top of menu
是否可以在 android firefox 的工具栏以及弹出菜单的顶部添加一个按钮,如下面的屏幕截图所示:
编辑:
刚刚找到一个插件的屏幕截图,该插件安装了一些其他插件,在上面添加了一个按钮,请查看插件屏幕截图:
https://addons.mozilla.org/en-US/android/addon/quitnow/
截图如下:
(来源:mozilla.net)
看看那个夜间地球仪和它左边的任何东西,我正在尝试做同样的事情:)第二张图片的第一行是工具栏按钮图标,当有足够的屏幕时,它会显示在顶部工具栏中space 我有兴趣学习如何添加到第一行和第二行
Developing for Firefox Mobile 的文档将所有 UI API 标记为 不支持 。 Mozilla 使用 Android 的原生 UI 为 Android 构建 Firefox。因此,与 XUL 相关的所有内容可能根本无法工作。
现在有一个Extensions for Firefox for Android API and the only thing related to what you'd like to achieve can be found with PageActions.jsm,可以这样使用:
Pageactions.add({
icon: "drawable://alert_app",
title: "My page action",
clickCallback: function() { win.alert("Clicked!"); }
});
这些已添加到工具栏,但显示在地址栏内部而不是旁边。在您发布的屏幕截图中,小书本图标是一个 pageaction。但也有一个限制:
NOTE: A maximum of two page action items will be shown to users at a time. If users have three page actions showing, an overflow menu will appear to handle the extra ones. Your action has NO control over whether its shown in the urlbar or overflow. Don't depend on your page action always showing in the main urlbar.
您在菜单顶部找到的按钮也无法更改。左边的星星是书签,右边的图形是分享网页的按钮。中间的 space 用于显示您与之共享网页的最后两个应用程序。
所以基本上,你想做的事情根本不可能,我知道试图实现类似使用页面操作的插件。
是否可以在 android firefox 的工具栏以及弹出菜单的顶部添加一个按钮,如下面的屏幕截图所示:
编辑: 刚刚找到一个插件的屏幕截图,该插件安装了一些其他插件,在上面添加了一个按钮,请查看插件屏幕截图: https://addons.mozilla.org/en-US/android/addon/quitnow/
截图如下:
(来源:mozilla.net)
看看那个夜间地球仪和它左边的任何东西,我正在尝试做同样的事情:)第二张图片的第一行是工具栏按钮图标,当有足够的屏幕时,它会显示在顶部工具栏中space 我有兴趣学习如何添加到第一行和第二行
Developing for Firefox Mobile 的文档将所有 UI API 标记为 不支持 。 Mozilla 使用 Android 的原生 UI 为 Android 构建 Firefox。因此,与 XUL 相关的所有内容可能根本无法工作。
现在有一个Extensions for Firefox for Android API and the only thing related to what you'd like to achieve can be found with PageActions.jsm,可以这样使用:
Pageactions.add({
icon: "drawable://alert_app",
title: "My page action",
clickCallback: function() { win.alert("Clicked!"); }
});
这些已添加到工具栏,但显示在地址栏内部而不是旁边。在您发布的屏幕截图中,小书本图标是一个 pageaction。但也有一个限制:
NOTE: A maximum of two page action items will be shown to users at a time. If users have three page actions showing, an overflow menu will appear to handle the extra ones. Your action has NO control over whether its shown in the urlbar or overflow. Don't depend on your page action always showing in the main urlbar.
您在菜单顶部找到的按钮也无法更改。左边的星星是书签,右边的图形是分享网页的按钮。中间的 space 用于显示您与之共享网页的最后两个应用程序。
所以基本上,你想做的事情根本不可能,我知道试图实现类似使用页面操作的插件。