I am trying to create a Firefox add-on that is restartless and has a menu entry in the Firefox App Menu (preferably in the Options sub-menu). I cannot find anything anywhere on how to add an entry to the app menu while being restartless! I am building it with the Mozilla Addon Builder. Any and all help would be appreciated!
In fact, there isn't really a way to do this. A "normal" restartless add-on has to enumerate all open browser windows and add a menu entry "manually" to the element with id="appmenu-popup". It will also have to watch for new windows being opened to make the same change there as well. While this is already complicated enough (bug 675387 is about making this simpler by allowing using overlays like in non-restartless add-ons) I strongly suspect that the Add-on SDK (that the Add-on Builder is based on) doesn't provide any way to do this at all. After all, it is only meant for add-ons that can live with a limited set of features.
Related
I would like to create a preferences window like in the standard Mac OS X apps (Safari etc.). I have found resources like DBPrefsWindowController from back in 2008 that matches the Apple HIG.
Just wondering if there is a new way to accomplish this? I can't locate any standard windows in Interface Builder so I assume Apple doesn't provide those, nor can I locate a official Apple sample code for providing this standard UI.
Thank you
It seems DBPrefsWindowController is no longer available.
For now, I would recommend the up to date RHPreferences framework.
Available on GitHub. BSD Licensed.
It’s a simple and easy Preferences window controller with multiple tabs for your next Mac application.
It also provides:
Auto resizing between different sized tab views (With animation)
Custom NSToolbarItem support
Persistence of the last used tab
Support for placeholder NSToolbarItems (eg NSToolbarFlexibleSpaceItemIdentifier & NSToolbarShowFontsItemIdentifier)
Are there any best practices to help your users install your Firefox extension?
I have a Firefox extension in the form of a button. The actual install is roughly OK, but getting users to
click on the Firefox menu
click Customize
drag and drop the button to their toolbar
close the menu
is just insane.
Do you know any services that did that in a specially clever way, or any best practice resource to lose as little users as possible?
After some investigation on the Firefox side, there is a way to do it automatically for the user:
How can I make my Firefox extension toolbar button appear automatically?
Google Chrome did this by default, so it's more something that you have to add in your extension to have a consistent experience.
Pocket does that automatically. They have a grey icon, in line with the default icons, which makes it easy to miss it altogether.
I am using firefox addon builder (Addon kit 1.7) and I wonder to know if it's possible to show a simple menu like the context menu of firefox just after clicking on the widget icon. I need few hints. Thanks in advance.
I managed to make it work using the MenuPopup package by Yaelle Borghini and uploaded a simple example on the Addon Builder site.
You will have to expand on Yaelle's code to support dynamic modifications of the menu items because it's not fully built in at the moment (though it shouldn't be too hard to add it).
Here's the discussion on the Mozilla forums about how to show menus with the Addon SDK that got me started.
Right now the only option is to hook a panel to a widget and add a menuitem to the panel with html.
I have gone through the examples of Add-on SDK 1.5 yet haven't seen anything like a web page which the addon can interact with the user and get input from him. There are only dialogs called panels and I really would like to have a real page in a tab like in google-chrome addons.
Is it even possible with the Add-on SDK (1.5)?
Of course you can create a tab, you use tabs.open(). As to interacting with this tab - you probably want to register a content script before opening the tab. Just like you would do it with Google Chrome.
Is it possible to create a native GtkMenu (I mean not XUL, but a real GtkMenu) from a Firefox extension? (and add to the firefox window). I would like to make GlobalMenu work with Firefox, which currently doesn't work due to the lack of native GUI.
If you want to have your menu inside firefox window, then... I don't know the details, but the usual way in X is to make a X window (for example GtkWindow) with your GtkMenu. Then you should make firefox "swallow" that window, something like all the systray utilities do that (keywords:reparenting X window--should be enough). I guess there should be special XUL element for than, but I don't see any.
If you dont want to, you can simply make your own GtkWindow with GtkMenu and show it. I guess you should probably do this from another thread. Regarding your other question here -- it is fully possible to write an extension in C++, as long as you use Gecko SDK and Gecko API. You can then link with whatever library you want, including GTK.
I think you should ask this question on one of Mozilla's mailing lists, for example mozilla.dev.extensions (they are listed on http://www.mozilla.org/community/developer-forums.html).