A blog for the Flagfox extension and its development

Current Flagfox 4.1.x supports:

  • Firefox 3.5 – 7.0a2
  • SeaMonkey 2.0 – 2.4a2

The max versions correspond to current Aurora channel builds for both Firefox and the SeaMonkey equivalent. For quite a while now I’ve been using Aurora Firefox myself and have more or less settled on a policy of continuing to keep Flagfox compatible with it. Minefield (now named simply Nightly) is not listed as compatible, however Flagfox does work perfectly with it at the moment.

Why does Flagfox not list compatibility with Minefield if it is?

Minefield is always, well, a minefield. It can blow up at any time. In the past Flagfox would sometimes support it if I were personally using it and during the run up to Firefox 4.0 I moved continued support for all prereleases to the beta channel as compatibility was breaking too often to fix in the main release channel. These days it’s currently somewhat stable but I have no clue when that will change again.

Fortunately for Nightly users, Mozilla has made accommodations for you. Instead of having to set individual compatibility checking override preferences for each version you can set “extensions.checkCompatibility.nightly” to false in about:config to disable compatibility checking in nightlies and keep it off even as the version numbers increment. If you’re using nightlies and wish to use Flagfox this is the suggested route. Just keep in mind that at some point Flagfox or any one of your addons may break, in which case I ask that you please report the problem so it can be addressed. You can report Flagfox compatibility breakages on the forums.

Future application support plans

One of these days I will get around to working on Flagfox 4.2 enough to post an alpha or beta. With that new major version I currently plan to drop support for Gecko 1.9.1, meaning Firefox 3.5 and SeaMonkey 2.0. I dropped support for Gecko 1.9.0, Firefox 3.0 and all Flock versions, with Flagfox 4.1 because supporting such old and obsolete browsers required not only a bunch of hacks but quite a bit of extra testing and futzing. Even then some features were simply not supported under Firefox 3.0 or Flock, namely the drag and drop features in the options dialog (importing/exporting and reordering actions). Firefox 3.5 isn’t that drastically different from Firefox 3.6, however now that the number of major Firefox versions Flagfox supports is up to freakin’ 7, I just can’t conceive of not going insane doing new development and trying to support all the way back that far. On more than one occasion I’ve written something new, tested it fully in the most recent couple browser versions, then tested it in Firefox 3.5 only to find that some quirk breaks something. It’s a mess not worth fighting with. Additionally, Mozilla has recently changed Firefox 3.5.x updating to go straight to Firefox 3.6.x as a minor update and 3.5 is now officially at its end-of-life. It was on borrowed time for many months but they finally dropped support for it and I will too. To summarize:

Current Flagfox 4.2 support plan:

  • Firefox 3.6 – 8.0a2
  • SeaMonkey 2.1 – 2.5a2

When this will be I don’t know yet. Honestly, I really would like to drop support for Firefox 3.6 too, but there’s simply way too many people still using it to consider such a thing yet. Flagfox 4.3 isn’t even on the drawing board yet but hopefully the usage stats eventually get to a point where I can drop it.

Footnote: There were a few thousand people still using an older version that was still in the development channel. I’ve deleted it from AMO so now all development channel users will now update to the current stable version. At some point when I post a Flagfox 4.2 alpha or beta I will add a first-run page in the current stable version shown only to Firefox/SeaMonkey prerelease users to offer it.

Flagfox 4.1 released

Flagfox 4.1.0 has been released and is now available on Mozilla’s Add-ons site for download or update.

Major changes in Flagfox 4.1:

  • Support for Firefox 4.0
  • Support for sites using IPv6
  • Some new optional default actions and updates to some old ones
  • New action placeholders and advanced functionality
  • Improvements to the options dialog and action management
  • Removal of old icon repositioning options due to Firefox 4.0 removing the status bar (see here for more info)
  • A handful of bug fixes and minor performance optimizations
  • Dropped support for out-of-date browsers: Firefox 3.0 and Flock

Detailed Flagfox 4.1 changelog:

  • Added full IPv6 support using data from Maxmind (OS & ISP IPv6 support required)
  • Added support for IPv4 mapped and compatible IPv6 addresses (IPv4 prefixed with “::ffff:” or “::”)
  • Added support for 6to4 and Teredo IPv6 tunneled IPv4 addresses
  • Optimized IP database reading a little bit
  • Added autocomplete for placeholders when typing into the template field in the new/edit action dialog
  • Improved icon tooltip to look better and be easier to read/understand and better to localize effectively
  • Added nationality of domain name to icon tooltip when applicable and differs from server location
  • Added new icon for about: URLs (about:blank still has its own new page icon)
  • Added new side menu for the add action button in the options dialog
  • Added new clone selected action feature (via add menu or ctrl+c hotkey in options)
  • Added new paste action(s) from clipboard feature (via add menu or ctrl+v hotkey in options)
  • Added link to custom actions forum to add menu
  • Added new {title} placeholder for page title
  • Added new {meta-*} placeholders syntax to get page meta tags’ data (ex: description, keywords)
  • Added new {locale-*} placeholders expanded syntax for getting specific settings (page, content, UI, OS)
  • Added new {TLD} placeholder to get the top level domain (public suffix; e.g. www.bbc.co.uk -> co.uk)
  • Added a text link label for the preview icons button in the options dialog to make it more discoverable
  • Added new default actions to the options: Internet Archive, SSL Checker, URL Parser, Wave a11y Check
  • Added Page Metadata default action to the options (opens in popup dialog)
  • Renamed old “Wikipedia” action to “Wikipedia: Country” and added domain and TLD Wikipedia lookups
  • Replaced Copy Country action with Copy Server Info action: “domain (ip) – country (code)”
  • Added proper support for “javascript:” actions; now executes in sandbox instead of opening URL
  • Made pressing delete key on custom actions in options also select next item for quick multi-deletes/undos
  • Replaced multi-pane help box in the edit action dialog with a single basics box and a popup for advanced
  • Added buttons for each placeholder in the advanced help popup to paste to the template field
  • Optimized options dialog action list generation to improve dialog load time with large action lists
  • Improved importing to be smarter: can now take in first found plain text URL or link as starting point
  • Improved drag & drop support to better strip bullet points when dropping action lists into options
  • Improved cold startup time slightly by delaying string bundle loading until needed for menu or tooltip
  • Fixed locale handling for some systems with mixed settings
  • Fixed icon not updating on page refresh if needed and improved performance of update check a bit
  • Fixed extra loading of country names list for edit action and icon set preview dialogs
  • Fixed some minor potential issues with hotkey handling
  • Removed old icon repositioning options now that Firefox 4 removed the status bar
  • Updated existing experimental Mozilla Weave/Firefox Sync support to use newer pref name format
  • Added extractionless XPI opt-out to install manifest for Gecko 2.0+ support
  • Added support for using the larger logo image in the Flagfox details view in the new Addon Manager
  • Removed old Flagfox 4.0 first run page (no more first run page for stable versions for now)
  • Dropped all support for Gecko 1.9.0 based browsers, including Firefox 3.0.x and all Flock versions
  • Removed all Gecko 1.9.0 support hacks
  • Dropped a few locales due to lack of translators to do updates: ca, fi, lt, mk, ms
  • This Flagfox version supports Firefox 3.5 – 4.0.* and SeaMonkey 2.0 – 2.1b3pre

Flagfox 4.1b3 released

Flagfox 4.1 beta 3 has been released today and is now available on Mozilla’s Add-ons site for download or update from prior 4.1 alphas/betas. This is a minor update with more locale updates and a bugfix for the new IPv6 support.

Changelog for Flagfox 4.1b3:

  • Fixed a bug sometimes causing incorrect IPv6 lookup results
  • More localization updates (translation still in-progress)

The changelog for beta 2 as well as information about the new IPv6 support is over here. The changelog for Flagfox 4.1 alpha 1 through beta 1 is over here.

For anyone curious about the technical details of the IPv6 support bugfix in this update, I’ve posted an explanation over here. Short version: be careful if you use JavaScript with big numbers.

Sometimes fuzzy variable types can bite you in the ass.

I tested my initial implementation of IPv6 support in Flagfox on quite a few sites and all seemed well when I released the first test version with it, Flagfox 4.1b2. Today I decided to test a wider variety of IPv6 addresses and compare them to expected results in the raw list. It turns out that a few of them were being looked up wrong. The problem in adding IPv6 support is that IPv6 addresses are big. Not just a few times bigger; way bigger. IPv4 addresses are 32-bit and IPv6 addresses are 128-bit. Four times the bits does not mean four times the number of possible address. Each bit you go up doubles the maximum number that can be represented, thus the number range isn’t 4 times larger, it’s 79228162514264337593543950336 times larger. To borrow a metaphor from The TCP/IP Guide: If you imagine the IPv4 address space is the size of a 1.6 in (4.1 cm) square, then the IPv6 address space would be represented by a square the size of the solar system. These IPv6 addresses when represented in full are quite big numbers, too big for me to deal with in Flagfox in fact. Fortunately, the way IPv6 is set up I don’t need to know about the whole 128 bits, I only really care about the first 64 bits. The first half is for the network and the second half is for the host on that network. The data Maxmind has for IPv6 is a list of those network prefixes and what country they’re in. Most are 32 bits and none are larger than 64 bits. So, I basically did the same thing I did for 32-bit IPv4 addresses except now with the 64-bit network prefix of the IPv6 addresses. Now, anyone guess where I went wrong? Logically, I didn’t; it’s the technical aspect that got me. Flagfox, like most extensions, is written in JavaScript. JavaScript, it turns out, can’t think in 64-bit numbers and its fuzzy variable typing was just silently dropping the less significant parts it couldn’t handle and just plugged along its way without any warning. (I was led astray by some Mozilla docs, but I’ll get to that later) I didn’t catch the problem until I tested artificially made up addresses that were too much for a JS engine to handle, at which point my search algorithm gave incorrect results.

So, what’s my fix then if JavaScript simply cannot handle the math needed to deal with the full IPv6 network prefix? I could theoretically switch out of JavaScript into C for the needed math using JS-ctypes, as C can do 64-bit math just fine, but that would be messy and JS-ctypes is new so I’d have to drop support for everything but Firefox 4.0+ which I don’t want to do. Instead, I’ve decided to just work within the limits. Those 64-bits for the network prefix can be broken down into two parts: the 48-bit global routing prefix and the 16-bit subnet ID. (The TCP/IP Guide reference on that is here; that site has been really helpful) Fortunately, JavaScript can deal with 48-bit numbers, which may be a weird size to do math with in programs, but it works. So for Flagfox 4.1b3 I’ve changed everything to search by the 48-bit main network prefix instead of the full 64-bit prefix including the sub-network ID. Out of the 6352 IPv6 address ranges in Maxmind’s current database, only 3 go down to the subnet level, so over 99.95% of the ranges are just fine with this. Unfortunately, this means any networks with subnet ranges in the database that span multiple countries aren’t able to be supported, but this is a very rare occurrence so it shouldn’t be a problem (for now). Hopefully in the future JavaScript just gets 64-bit integer support and I can upgrade to the full route I initially tried.

Now, how did I make this mistake in the first place? I’m using the nsIBinaryInputStream interface to read my IP database files and it has a perfectly normally listed read64() method just like the read32() method I was already using. There’s actually not anything wrong with this if you’re using that interface from C, but if you’re using it from JS, then you’re going to hit this problem. In order to hopefully avoid someone else making this same mistake, I have edited the online documentation to add a little warning next to the read64() method about the fact that JS does not currently support 64-bit integers.

Flagfox 4.1b2 released

Flagfox 4.1 beta 2 has been released today and is now available on Mozilla’s Add-ons site for download or update from prior 4.1 alphas/betas. The big change this beta is the addition of IPv6 support. Flagfox now contains two internal IP location databases, one for IPv4 and one for IPv6, both using data from Maxmind converted to a custom file format for Flagfox. The various transitional IPv6 addresses which have an IPv4 counterpart that can be determined are also supported and will be looked up using the current IPv4 database.

This is also the first beta to have locale updates for the new strings. Some languages are already complete, others are in progress, and others have yet to be worked on. If any of your locale’s strings are not yet updated they will show in English for the time being.

Changelog for Flagfox 4.1b2:

  • IP address location database update for February 2011
  • Added full IPv6 support using data from Maxmind (OS & ISP IPv6 support required)
  • Added support for IPv4 mapped and compatible IPv6 addresses (IPv4 prefixed with “::ffff:” or “::”)
  • Added support for 6to4 and Teredo IPv6 tunneled IPv4 addresses
  • Added localization updates for new strings (translation still in-progress)
  • Fixed a few minor issues with the new tooltip
  • Reworked full help popup in edit action dialog to size and look better
  • Optimized IP database reading a little bit

The changelog for Flagfox 4.1 alpha 1 through beta 1 is over here.

The IPv6 support in Flagfox is bran-new and it would be helpful if as many people could test it out as possible. If like me your ISP does not support IPv6 yet there are free services online that are available, though they may provide slower speeds than if your ISP supported IPv6 natively. I’ve been testing using Hurricane Electric’s free service however there are others out there you can use.

Note that your operating system must also support IPv6 and have its support enabled. Also, if you’ve ever disabled IPv6 support via about:config, don’t forget to turn that on there too, but it should be on by default normally.

You can use ipv6-test.com and test-ipv6.com to test your system/connection IPv6 capabilities. (two very similar names, but they’re both useful in different ways)

Flagfox 4.1b1 released

Flagfox 4.1 beta 1 has been released today and is now available on Mozilla’s Add-ons site for download or update from 4.1 alphas. Major changes from the final alpha version include autocomplete functionality when typing into the add/edit custom action template field, a new better tooltip for the flag icon, and removal of the now largely obsolete additional icon repositioning options (on that see here).

The full combined changelog for Flagfox 4.1 development versions to date is:

  • IP address location database update for January 2011
  • Added autocomplete for placeholders when typing into the template field in the new/edit action dialog
  • Improved icon tooltip to look better and be easier to read/understand and better to localize effectively
  • Added nationality of domain name to icon tooltip when applicable and differs from server location
  • Added new icon for about: URLs (about:blank still has its own new page icon)
  • Added new side menu for the add action button in the options dialog
  • Added new clone selected action feature (via add menu or ctrl+c hotkey)
  • Added new paste action(s) from clipboard feature (via add menu or ctrl+v hotkey)
  • Added link to custom actions forum to add menu
  • Added new {title} placeholder for page title
  • Added new {meta-*} placeholders syntax to get page meta tags’ data (ex: description, keywords)
  • Added new {locale-*} placeholders expanded syntax for getting specific settings (page, content, UI, OS)
  • Added new {TLD} placeholder to get the top level domain (public suffix; e.g. www.bbc.co.uk -> co.uk)
  • Added a text link label for the preview icons button in the options dialog to make it more discoverable
  • Added new default actions to the options: Internet Archive, SSL Checker, URL Parser, Wave a11y Check
  • Added Page Metadata default action to the options (opens in popup dialog)
  • Renamed old “Wikipedia” action to “Wikipedia: Country” and added domain and TLD Wikipedia lookups
  • Replaced Copy Country action with Copy Server Info action: “domain (ip) – country (code)”
  • Added proper support for “javascript:” actions; now executes in sandbox instead of opening URL
  • Made pressing delete key on custom actions in options also select next item for quick multi-deletes/undos
  • Replaced multi-pane help box in the edit action dialog with a single basics pane and a popup for advanced
  • Added buttons for each placeholder in the advanced help popup to paste to the template field
  • Optimized options dialog action list generation to improve performance
  • Improved importing to be smarter: can now take in first found plain text URL or link as starting point
  • Improved drag & drop support to better strip bullet points when dropping action lists into options
  • Improved cold startup time slightly by delaying string bundle loading until needed for menu or tooltip
  • Fixed locale handling for some systems with mixed settings
  • Fixed icon not updating on page refresh if needed and improved performance of update check a bit
  • Fixed extra loading of country names list for edit action and icon set preview dialogs
  • Fixed hotclick menu in edit action dialog to not truncate long localizations or resize menu to selection
  • Removed old icon repositioning options now that Firefox 4 removed the status bar (see here for more)
  • Updated existing experimental Mozilla Weave/Firefox Sync support to use newer pref name format
  • Added support for using the larger logo image in the Flagfox details view in the new Addon Manager
  • Dropped all support for Gecko 1.9.0 based browsers, including Firefox 3.0.x and all Flock versions
  • Removed all Gecko 1.9.0 support hacks
  • Added extractionless XPI opt-out to install manifest for Gecko 2.0+ support
  • This Flagfox development version supports Firefox 3.5 – 4.0b11pre and SeaMonkey 2.0 – 2.1b2pre

Known issues:

  • A SeaMonkey bug has been fixed for SeaMonkey 2.0.12 and 2.1 which will fix the minor address bar history drop-down menu bug affecting all Flagfox versions since 3.3 up to and including 4.1.
  • The new full help popup in the edit action dialog is in need of some improved styling.
  • Internal pages from the about: and chrome: protocols need their own new tooltips.
  • Localization is still pending…

Now that Flagfox 4.1b1 is finally out for testing and I have a blog set up, please feel free to give comments here. You can also email me directly or post in the Flagfox forums.

This beta release is not yet localized but I’ll be uploading a version to BabelZilla for translation soon. There were more than a few delays in getting to this point, not the least of which was my old laptop dying completely, but we should hopefully be able to get through another beta or two and the translation process before Firefox 4.0 is due for release so updating users can update Flagfox to get continued support from the start.

Follow

Get every new post delivered to your Inbox.