Damn, has it been that long since I posted this? I keep postponing my reply and end up overdoing it. Sorry for those of you who asked questions. Hopefully the scope of the post will make up for it.
First, a notes that may be old news for you, but regardless. Despite being unable to compile PM, VSCode is able to debug it with the use of the PM symbols files, and using the Debugger for Firefox, it can debug seemingly any FF/PM extension.
Second, should I message Moonchild to ask for a pointer on which files contain the JS code available to add-ons? I don't know how busy he is or how receptive to requests. I'm fairly sure IDL files point towards all JS APIs written in C++, but I don't know if there are other APIs written in Python or JS itself.
Oh I didn't know it could help with add-on devving, thank you.
vannilla wrote:It depends and testing them yourself is the only way to know.
Ah well. Maybe if I can put together a comprehensive doc of all PM add-on entities, it would be possible to program a utility to scan a FF add-on to see if it matches PM's specifications?
Yeah, it's just that having the reference docs on hand is just the way I prefer to code. You know how sometimes you end up coding some horribly hacky function to do something important, only to find out later that the default l/g/d already had the perfect solution tucked away in the docs?
vannilla wrote:I don't really understand the whole thing about DefinitelyTyped and all that jazz. If it's something like autocompleting stuff, I don't use any of it and never had issues.
It's the closest thing there is to standardized code intel so far. It's one or more TypeScript files usually ending in *.d.ts that lists the types, standard functions, syntax etc. of a language, tho it can be made for a 3rd party library, or some dialect, or a specific program's l/g/d such as Mozilla's add-on development. So instead of each IDE having to implement each language at a time and all by itself, they just have to make their code intel engine read those files. It's a Microsoft thing so I guess it's part of their "embrace, extend, extinguish" thing.
vannilla wrote:Also, when working with UI (which is, like, 90% of the time), the only way to know what ID to use to position elements is to read the browser.xul file itself.
I found some interesting XUL tools I describe below.
Fedor2 wrote:I myself never used such tools, no really need and no much time to test them all, but i would like to have a visual xul editor, something like office vba, in case the best i know of code edit. Did you encounter tool with this functionality?
I searched all over and did a lot of internet archeology (thanks, Archive.org), and I found a surprising amount of XUL tools. It seems that early on, FF devs talked about making a proper IDE for XUL, but they didn't get organized so intead everyone made their own tools, simpler than IDE. The downside is that most of these tools are really old for internet standards. Then again, XUL's specifications weren't altered too often, so they have a good chance of working. The tools add-ons in the next paragraph all claim to work for any version from 4 or less all the way to 56, so odds are they work fully for PM. I haven't tested most of them yet, mind you.
First, I have not tested the vast majority of the tools I'm about to list due to simple lack of time, as there's too many. That said, despite the stated above, I did find interesting tools:
- XUL Explorer: a standalone visual XUL editor. It has XUL reference and a visual preview of your XUL code, but it's a separate pane so you can't see the code and the preview at the same time. Also no drag-and-drop.
- Mozdev Project Wizard: only now I discovered Mozdev has a little online tool to kickstart some Mozilla stuff, including add-ons. But it's aimed at the old FF system, which needed signing and some work to make the XPI and such.
- XulApp: a really damn old (the dev talks about FF 1.1), unfinished IDE, but which claims to have a drag-and-drop form editor. No JS support, however. He also made library called XaLib which can be used in other projects and supposedly adds some niceties to add-on coding, including a "really simple way to access widgets from JS. Goodbye to getElementById".
- The version in the CVS repo folder "xulapp/" is newer and has no installer, whereas the version available for download in the site, which is 0.2.13, is the one present in the repo folder "xulappold/". However, I haven't managed to get it to work at all so far, altho I think I will manage to do it.
- XUL Gear: a XUL editor with preview window, all elements there to be inserted with a click, with attributes to be easily set and all, but it doesn't have graphical drag-and-drop, tho the treelist has it. Oh, and it has been broken since FF 20, when E4X was removed, and its reference is obviously outdated, as with most tools in this post. It seems that it can be updated to work with PM (and FF 56, for that matter) with a bit of work, or with XULRunner. In the meantime, there are two possibilities to use this tool now...
- The first method is slightly more inconvenient but amusingly oblique. You see, there used to be an audio player built on XUL called Songbird, which folded in 2013. It had a surprising amount of add-ons, some of which can still be rescued via Archive.org and possibly be of some use for someone. In any case, an open source, fan-made fork called Nightingale kept on going... for six more months. But at least they have hept the site and git repos going. And what's interesting is that the latest XUL Gear can be run on it with minimal alteration. Grab the latest version on the AMO link a couple of paragraphs above, open its install.rdf and replace firstname.lastname@example.org with email@example.com. There you have it, just repack it, install it in Nightingale and it works identically as it would in old FF versions. There are just three caveats: like I mentioned above, its reference is outdated (it's from FF 4.0!); the navigation toolbar button is a thin, image-less button because the dev used a SVG for a pic (but it can also be accessed via Web Developer menu); and sometimes the arrowscrollboxes in the middle section disappear (always happens when I change to layout B then to layout A). Nightingale also has its own developer tools based on the Extension Developer's Extension which I showcase a few paragraphs below, in case you have any ideas in mind. It includes XPCOMViewer, XUL Periodic Table, XUL Editor XUL Explorer and more.
- The second method is probably for us. Simply download FF Portable 19.0.2 from PortableApps.com's Sourceforge archive (Windows only, I'm afraid) and you can just install XUL Gear and go at it. I guess the portable FF has version compatibility check disabled. Regardless, this has the same two caveats as above -- outdated references, image-less toolbar button and buggy arrowscrollboxes in the middle section -- but has a small new benefit, in that the middle section can be scrolled with the mousewheel. Otherwise, this seems to be identical to using this tool on Nightingale or FF 4.0.
A small interruption for a question: do you think it's worth the time and effort to fix XUL Gear for PM and/or XULRunner? The former is more immediately useful to us, while the latter is easier to port and can be a "standalone" program -- which doesn't have much point nowadays, what with XUL being dead. Either way, XUL Gear could be brought up to date and used in a hypothetical PM add-on dev kit. On the other hand, I don't know if this is the best tool, so I'd rather at least someone here gave these a whirl a vote for the best XUL editor.
One of MDN's page about setting up an IDE specifically for add-on development
(there's a second one
, because Mozilla's docs are a mess) suggested these:
- Komodo IDE: the centerpiece, obviously. It still uses XUL, and it's the only IDE I found with at least partial code intel for XUL, as well as Mozillas's CSS extensions.
- DOM Inspector (add-on): apparently it can edit too.
Venkman debugger: yeah, the MDN page in question is old, even if it was updated sometimes. This is beyond obsolete.
- Tamper Data (add-on): not related to XUL but MDN recommended this for fooling around with HTTP headers, parameters, requests etc.
Firebug + Chromebug: I'll expound on them below.
- Leak Monitor: also unrelated to XUL, but potentially valuable.
The second MDN page about setting up an IDE has a long list of add-ons to help development
, it's also a bit outdated. Some I mentioned above, some are beyond the scope of XUL (but I recommend you check the list regardless), so I'll list the more useful ones for us. Unlike those above, these have varying FF version requirements:
- Extension Developer's Extension, a.k.a. Developer's Assistant: a variety of utilities to make FF/PM add-on development easier: XPCOMViewer, XUL Periodic Table, XUL Explorer, XUL Editor with live preview (but sadly no XUL reference), HTML editor and more. Apropos of which...
- Extension Developer's Extension's developer page: don't download the XPI on the top, it's outdated, get the one in AMO, the link is in the previous item. Anyway, you can use several of the extension's utilities here, but you'll notice the live XUL Editor in the site doesn't work (the one in the add-on has no issues), giving you a message akin to "remote XUL is disabled". Which leads me to...
- Remote XUL Manager]: Turns out giving webdevs' capacity to run their own XUL code on someone else's browser was a security risk, unsurprisingly. So you have to whitelist any sites with XUL files you want to run, and this add-on makes it easy. The newest version works on PM 28.
- [url=https://github.com/gijsk/chromelist/]Chrome List: lets you view chrome:// stuff. Dunno if it has its own data or if it grabs from the browser.
- XPCOMViewer: lets you view XPCOM stuff. Again, dunno if it has its own data or if it grabs from the browser.
- XUL Periodic Table (requires Remote XUL Manager) (downloadable version): an old workhorse, but horribly outdated, being stuck in 2003.
- MozRepl: command line tool to dig into FF/PM and individual web pages.
- Cycle Collector Analyzer, about:ccdump: not related to XUL but seems valuable for debugging add-ons and maybe PM itself.
Lastly, a note on ol' Firebug:
(Chromebug user guide
: a special case. I'm fairly sure that Firebug's features have been superceded by both FF's and PM's native devtools, but some of its add-ons
have specialized functions. Chromebug, specifically, lets you debug XUL applications, which is pretty much synonym with legacy addons. The problem is, the newest version of Chromebug is fairly old, and it's only compatible with a similarly old version of Firebug. Namely, the version in question is 1.8.0a2. Anyway, PM already has an option to debug restartless extensions, but as far as I know, it can't do it to overlay extensions. And God knows about PMkit ones.
And I still haven't gone through all of them, but I'm finishing the list here for now, or else I'd never finish this post. I still have to go through most of this list in the Mozilla wiki
, this one relic called Vixen
(which seems to have nothing to see, actually), XML editors which might happen to support XUL, some increasingly obscure candidates (one of which, ATF for Eclipse, I mention below), and I bumped onto several XUL-related projects in a Perl site
. I don't know a lick of Perl, but I guess I can look around.
Fedor2 wrote:UXP very need to have good development environment with compiled help, this is important for UXP become such a thing, instead only Palemoon or Basilisk.
I'm afraid I'm still too unexperienced for helping with UXP.
Isengrim wrote:Pale Moon is roughly equivalent with Firefox 52 in terms of extension support, sans WebExtensions.
Well I'll be damned, I and a lot of other users have been missing out on a lot of newer extensions. Why not set the FF useragent in PM to 52 when visiting AMO?
Isengrim wrote:Your best bet is the browser's built-in devtools (element inspector, JS/error console debugger, style editor, etc.),
The current tools really are terrific, it's just lacking the ability to debug overlay extensions which require rebooting.
If you want to use the dev tools for extension work, you'll need to enable chrome and remote debugging (see here
). The dev tools do have some code completion available in the console as well as some limited cross-referencing capabilities, which may prove useful to you.
Huh, remote debugging is how I had been debugging in VSCode + Debugger For Firefox, but it didn't occur to me to use the native tools that way. Thanks. But that can't isolate overlay add-ons like PM's own debug button for bootstrapped add-ons can, can it?
ketmar wrote:i once started a visual XUL designer project, but for many reasons i am unable to work on it for now. it is not abandoned, though, just put on hold. i have to catch up with new XULRunner and port my standalone XULRunner framework to the new version, and this is something i cannot do right now, due to IRL and hardware issues.
Wait, new XULRunner? Mozilla stopped in 2015 and PM's hasn't been updated since 2016.
Anyway, I found something you may find useful. It seems an (abandoned) Eclipse project called ATF
has managed to stuff XULRunner into a plugin, which might also actually include some useful information about FF's APIs for my reference docs.