Group Policy Extension for Firefox

I've been working with Cesar Oliveira from Seneca College to put together some initial attempts at group policy support. Here's his comment from bug 267888:

Since there doesn't seem to have been any communication from the assignee for
over a year, I am guessing that he is no longer working on it. With big help of
Michael Kaply (mkaply), we went into a different approach with this bug.

Instead of doing our own ADM template, we decided to do an implementation using
generic IE policies (gpedit.msc) that both browsers can share. For example,
setting the home page and enforcing full screen, and even disabling tabs! This
won't be the best solution, because Firefox and IE are different in many ways.
But it gives us something to start with, as IE is already in the corporate
world, we might as well try imitating some of their success ;)

We haven't implemented every policy (only slightly over a dozen). And it
definitely needs some polish to the functionality and the code. There are some
ways to get around certain policies (we don't do any preference locking), but
it is certainly better than not moving forward.

The code was designed to go into the mozilla\extensions directory. It works
with the latest version of Firefox3 (Firefox3.0b5pre), but not Firefox 2
(started using fuel). You can check out the source code via svn:

I am also making available an extension you can use. I haven't done much
testing with it, other than it installs and works with no tab browsing and
enforce full screen:

I also made a list of policies that we implement. Please feel free to look and
give feedback.

So now I am requesting community feedback. What is going to stop this from one
day getting into the tree (I assume everyone on the CC list wants something
like this in)? Other than using IE's policies, of course ;)

I think I got everything. If something is not working, feel free to email me.

This is really a first step, but I hope people will try it out.

Microsoft Activities for Firefox - New Version

I have an update for Activities that adds preview and fixes some bugs. If you just want that, skip to the end of the post.

One of the things I realized as I worked on this extension is just how amazingly easy it is to write Firefox extensions. When you combine great technology (Firefox extensions), great people (like Mark Finkle, for example), great documentation (, XULPlanet) and open source, it's amazing what you can produce and how fast you can produce it, as noticed in Compiler from

Compare this to my experience with Internet Explorer.

One of the things I wanted to do with Operator was make a version for Internet Explorer. I spent a few weeks trying to find good documentation on creating a toolbar for IE, and I have to say it was sorely lacking. I got a basic HTC working, but compared to my experience working on Firefox extensions, it was just SO painful, I gave up. I realize I'm not a Windows programmer, and that might have helped, but I just couldn't believe how hard it was to create extensions for IE. It's not even called a toolbar, it's called a a toolband which started me off in the wrong direction!

In a way, that was kind of sad because I was feeling like my focus on web development and in particular Mozilla and Firefox browsers was limiting my skills so that when it came to things like Windows development, I was at a disadvantage. (I've been working in the browser space and the development of web browsers for over 12 years). Hopefully, though, what I've actually done is cultivated a set of specialized, but very useful skills so that when other opportunities come up, I'll be able to take advantage of them. Especially since it seems like my work at IBM is requiring less and less of those Mozilla/Firefox skills.

So all that to say, I've thoroughly enjoyed working on the Microsoft Activities extension and the other extensions I've done and I hope that there will be more opportunities to do that, whether inside or outside IBM. Maybe I'll have a chance to talk to some folks about that at SXSW this weekend.

On to the new release. Version 0.3 of Microsoft Activities for Firefox is available (make sure you didn't grab the 0.2 that was up for a few minutes this morning). Features include:

  • Preview mode (only in FF3)
  • Problems adding services in FF3 have been fixed
  • Issues with query parameters fixed (all current services have been tested)
  • UI is updated immediately when a new service is added
  • Activities menu identifies the context you are acting in, and activities are limited based on that context (selection, link, document)
  • Built-in link to take you to the IE8 Service Gallery
  • Verified it works on Mac OS X

Interaction with the preview window is a little quirky, but I'm working on that. Surprisingly it seems to work better than IE8.


More Microsoft Activities for Firefox (Calling out Microsoft)

I've made lots of progress since yesterday. I hope to have a new version available today. I thought I'd start the day by calling out Microsoft for not even following their own spec (and you too Yahoo!). What part of 320x240 preview window do you not understand? (And yes there is stuff offscreen even if the scrollbars aren't there)

You can check out other providers (who got it right) here.

And one more thing - is it AddService or addService? The reference page says "AddService" but links on the Service Gallery say "addService." (I got an answer - it's addService)

Microsoft Activities for Firefox

After looking at Microsoft Activities in IE8 and noticing that they look suspiciously like my ideas around actions in Operator, I decided to implement them in Firefox.

For your downloading pleasure, here is a first pass at Activities support in Firefox. I haven't actually looked at IE 8, so what I did was based on the page about Activities I saw this morning. You can install activities from the Service Gallery, and then if you open a new window, those activities will be active (they don't become active in the page you download them from - working on that). To use an activity, highlight some text and right click on it.

If folks think this is interesting, I'll keep working on it. Enjoy.

Note this doesn't support previews yet - I'm working on that.

Operator 0.9g (Release Candidate) available

I'm making a release candidate for Operator available hoping that I can shake out any last bugs in it. It's available here. Note the release candidate is English only. I have it on Babelzilla at this moment getting translated.

First the caveat - RDFa support is not baked in this version (as in RDFa the old way doesn't work, and RDFa the new way doesn't work). That's mainly because the RDFa spec was in flux. I think it's done now and hopefully we'll have the RDFa parser before I release the official 0.9.

So what is going to be new in 0.9? Lots of bug fixes and improvements to general interpretation of how microformats work. I detailed this in a previous post, but here are some highlights:

  • Songbird support!
  • Fixes to make sure things work in Firefox 3
  • Menus no longer magically disappear on some pages
  • hCards supports nested menus to access actions (more logical than trying to use adr for multiple addresses)
  • Nested microformats are now handled per the spec as best we can figure it out
  • Performance should be much better (and it has been in my experience)

I hope some people will try this out and let me know how I did. I'm trying to get 0.9 out next week for SXSW. Thanks!

ONE MORE THING: If your microformat is hidden (via CSS or otherwise), it will no longer display in Operator by default! You need to turn on the "show hidden microformats" preferences. See this post.

Exemptions, Allowances and Deductions: How to reduce your federal tax refund

Update: I've created a new calculator for 2014.

A little change of pace. Let's talk taxes.

One of the things I do in my spare time is facilitate Dave Ramsey's Financial Peace University. I'm also one of Dave's Certified Counselors. One of the situations that comes up a lot (especially this time of year) is people getting large tax refunds. They don't understand why large tax refunds are bad and they don't understand how to use the allowances or exemptions on their W-4 (PDF) to reduce their refunds. I'd like to try to clear things up. Note that I am not a tax professional or an accountant, and your situation may be fact dependent. If you need specific advice, your should go to a professional.

Why tax refunds are bad

Just to be clear, tax refunds are a no interest loan to the government. Every dollar you get in a tax refund is a dollar that you could have taken home at some point during the year. I see people struggling to make their bills month to month, but getting large refunds. They don't realize that they could be bringing that money home in their paycheck instead of waiting to get it in April by changing their allowances. This would help a lot of their struggle.

What are allowances?

Before we talk about reducing your refund, we need to clear up the concept of allowances vs. exemptions vs. deductions, since this is what causes much of the confusion. The W-4 form (PDF) allows you to specify your allowances (sometimes called exemptions). It also provides a some worksheets to help you try to figure out your allowances. Most people rely on these worksheets to figure out their allowances without looking at their overall tax situation. These worksheet attempts to guess what deductions you will have on your taxes so that it can then compute how many allowances you should take. It might work if you are filing a 1040EZ (PDF) or have a simple tax return, but for most people it simply doesn't cut it. So how do I determine my allowances? We'll go into that in a minute, but let's again define our terms. Allowances or exemptions are about the amount of money that is taken out of your paycheck during the year. Deductions are about things you deduct from your income when you do your taxes.

So how do I determine my allowances?

Generally it is pretty difficult to predict your taxes for the following year. So what we are going to do is attempt to use the refund you got this year to modify your allowances so you get less of a refund next year. We're going to do that using a worksheet I created. This worksheet will allow you adjust withholding allowances interactively to see how they will impact your take home pay. Let's take a specific example (Note I completely made these numbers up.)

Bob is paid weekly. He makes $1000 dollars a week. He does not contribute to his 401(k) and he does not have any health care expenses taken out of his paycheck. He is single and is not claiming any allowances, so the government is taking out the maximum amount of income tax. He did his taxes and he discovered that he got a $3000 refund. He wants to know how he can take that home instead of giving it to the government. Here are the steps to follow:

  1. Figure out how many paychecks you have left this year. Bob is did his taxes on April 15, so he has approximately 38 (52-14) paychecks left this year.
  2. Divide your refund by the number of paychecks left in the year to get the additional amount you want to take home each paycheck. For Bob, this is about $79 (3000/38).
  3. Fill out the information in the worksheet using a current paycheck. This is to verify that the worksheet is computing your data correctly. For Bob the government should be taking out $169.70 each paycheck for taxes. He can look at his paycheck to verify this.
  4. Change the withholding allowances on the worksheet to adjust your take home pay so that it is increased by the amount you want. For Bob, our target is $832 ($753+$79). By adjusting the allowances on the spreadsheet, we see that five would take us over our target, four would take us under. Most people would rather get a refund, so Bob should set his allowances to four.
  5. Fill out a new W-4 form (PDF) and submit it to your payroll department. Some companies might provide an online way to do this.

Note that you can also use this method to take home money during the year if you know FOR SURE you are going to be getting a tax credit. For instance, if you adopt a child, you get a tax credit of $10,960. Instead of waiting to get that as a refund, you can simply adjust your allowances so that you get that money during the year. Only do this if you KNOW the adoption will be finalizing before the end of the year!

Some people might find that because they give a lot to charity or have a lot of deductions, that they might need to set their allowances over ten. When you try to do this, your employer might say something scary about needing to notify the IRS if you go above ten. Don't worry about it. It's just a formality. There is nothing wrong with going above ten allowances as long as you are not doing this to try to avoid paying taxes during the year. When I adopted my children, my allowances went way over ten. It's not a big deal. The important thing here is not to use this method to take home all your money and then pay a lot at tax time. If you do this, the IRS will start requiring you to pay quarterly taxes. Our only goal is to reduce our refund.

Finally, if you know you are going to be paying capital gains or some other extra tax, this computation might not work for you. So be careful.

So to summarize. You don't want a big refund. Take your money home during the year. Use my 2008 Withholding Allowance Calculator to figure out how to adjust your allowances.

Nerd Note: The amount of each withholding allowance is based on your marital status and your pay cycle. It is also dependent on the specific amount of your pay (the percentage changes as your pay goes up). If you are curious how this works, you can read IRS Publication 15 or just read my JavaScript code.

Firefox, Group Policy and Active Directory

One of the complaints that seems to come up a lot with regards to Firefox in the enterprise is the lack of support for management via Active Directory (using Group Policies). There have actually been a couple attempts to solve this including FirefoxADM and WetDog. There is even a company, FrontMotion, that makes custom Firefox MSIs that can be managed via Active Directory.

I decided I don't know enough about this area, so I've spent the past couple weeks investigating what Microsoft provides and the results actually surprised me: IE configuration via Group Policies seems to focus much more on customizing the browser(*) than it does on configuring individual preferences. Learning this made me wonder what exactly it is that people mean when the say that Firefox has a lack of support for Active Directory. Do they mean using Active Directory to manage install and updates? Or do they mean the types of customization that are provided via IE's Group Policy.

So I'd like to pose a few questions to my readers:

  1. Do you use Active Directory and Group Policy to manage Internet Explorer? If so, what policies are most important to you?
  2. Do you use FirefoxADM or WetDog to manage Firefox? If so, what features are most important to you?
  3. If support for Group Policies was implemented for Firefox, should it focus more on customizing the browser or setting preferences?

For more information on this subject, here are some links:

(*) By customizing the browser I mean things like removing printing, removing the help menu, removing view source, removing the context menu, preventing saving files to disk, removing the ability to open new windows, turning off tabbed browing, removing access to bookmarks, etc.

Simple Firefox Customizations: What Else Can I Do?

Before we get started on this next topic, I need to make one correction. In earlier posts, I said to use collapsed="true" to hide XUL menuitems. A better option is to use hidden="true" instead. Using collapsed doesn't hide the margins, so you get a lot of whitespace in your menus.

I also mentioned customizing the toolbar in my last post. We'll actually save that for a future post.

Now that we've seen how to create XUL overlays to modify menus, let's try out a real world scenario to see what else we might need to do. Let's say we want to remove the user's access to "Full Screen" mode. (I have no idea why you would ever want to do this, but Microsoft provides it as a customization in their group policy, so someone must want it.) Removing the menu is the easy part. We look in the file and see that the ID of the menu is fullScreenItem. So by adding this code to our overlay: we make the menu go away.

But we have a problem. The user could also press F11 to use "Full Screen" mode. How do we stop that? Luckily key commands are also defined in XUL, so we can modify those. Most key commands are defined in the file Searching through this file, we find:

<key id="key_fullScreen" keycode="VK_F11" command="View:FullScreen"/>

By simply adding this line to our overlay:

<key id="key_fullScreen" command=""/>

we prevent the keystroke from working.

That was an easy one. Let's try something harder. Let's remove access to "View Source." View Source can be accessed three different ways, the View menu, the keystroke Ctrl+U, and View Page Source on the page's context menu. Let's remove all three. We already learned how to remove the keystroke: What about the context menu? Removing items from the context menu can be done exactly the same way as removing items from any other menu - with hidden. The question is where do we get the IDs for items on the context menu. Similar to the main main and they keystrokes, it is stored it its own file, Here we see that the ID for the view source item on the context menu is context-viewsource so we can just add

<menuitem id="context-viewsource" hidden="true">

to our overlay. OK, one last thing. Let's remove the actual View Source menuitem. Looking in we see:

 <menuitem accesskey="&pageSourceCmd.accesskey;" label="&pageSourceCmd.label;" key="key_viewSource" command="View:PageSource"/>

Wait a minute. This menuitem has no ID? How can we hide it? Luckily we can put JavaScript into our XUL overlay as well. In cases where we don't have an ID, we have to write custom JavaScript to do our work. Here's some code that hides the View Source menuitem:

<script type="text/javascript">
    for (var i=document.getElementById("menu_viewPopup").childNodes.length; i !=0; i--) {
      if (document.getElementById("menu_viewPopup").childNodes.item(i).getAttribute("command") == "View:PageSource") {
        document.getElementById("menu_viewPopup").childNodes.item(i).hidden = true;

This code uses JavaScript to find the View Source menuitem and explicitly hide it. It does that by getting the length of the View menu popup (the number of items on it), and traversing backwards through the menuietems until it find the View Source menu. Then it explicitly sets the hidden attribute on the View Source menu. The reason we know this is the View Source menu is because we were able to look in the to see other properties that are only set on that menu (command="View:PageSource").

So now you should have most of the tools in your toolbox to remove functionality from the Firefox menus using the CCK to create the XUL overlay.

Simple Firefox Customizations: What Can I Change?

Now that we know where to add our XUL changes in a CCK XPI, let's take a look at what we can change. You'll remember from the previous post, we added this line:

and we were able to disable the Options... menuitem. The obvious questions then are, what else can I do and how do I find out what things I can change.

First let's talk about what you can change. It's beyond the scope of this article to go into all the things you can change with XUL. If you want to learn more about XUL, you can check out XULPlanet. For enterprise customization, there are probably two main things we would want to do: disable something or make it go away. We already know how to do disabling, but how would we make the Options... menuitem go away? The answer is the collapsed attribute:

This will make the menuitem go away completely.

OK, so we know how to change the XUL, let's find out what we can change. You'll notice that in order to change the menuitem, we needed to know the ID of the menuitem. So how can we find the ID of what we want to change? For this, we need to understand a little more about how the Firefox UI works. Most of the main Firefox window's UI is contained in a file called browser.xul. By looking through this file, we can find various parts of the UI and use our knowledge of overlays to change them. For instance, looking through that file, we find out that the ID of the toolbar is toolbar-menubar. So if we wanted to make the menu go away, we could simply add:

Note that not only did we need to use the ID, but we had to use the name of the tag (toolbar) as well. You'll notice that the menu is not in browser.xul (you won't find menu_preferences, for instance). This is because the menu is contained in a separate file called You can consider this file to be a part of browser.xul for our purposes.

If you're having trouble finding some UI in the XUL file, try this. Go to the Mozilla 1.8 Cross-Reference and search on the text you are trying to find. For instance, we'll search on "Error Console." This will return a DTD file that contains the string for the menu item (we want the one that begins with browser). On the same line as the text, you'll see an identifier that usually ends in label. For the error console, it's

By searching on the label, we can find the exact place where it is used in Firefox. In this case, it points us to We can use the information there to create an overlay that disables or removes the Error Console menuitem.

In the next installment, we'll learn how to customize the default buttons on the toolbar.

Firefox Enterprise Article in Computerworld

Computerworld has an article out today about Firefox in the enterprise that contains some quotes from me. There's also some slashdot discussion, but most of that seems to be from people who don't really understand enterprise requirements.

Unfortunately I didn't respond quickly enough to the request for information, so my stuff is kind of tacked on to the end. Here's the key message I wanted to get across (which wasn't in the article):

The main thing we think has changed at this point is that we (IBM) are working with the Mozilla Community to try to get the community more interested in the enterprise things. In particular, we (the community, as well as IBM) want to help enterprises with customization and deployment of Firefox, as well as work to figure out what can make Firefox better for the enterprise.

I agree with the overall article though. More needs to be done to make Firefox enterprise ready. Hopefully anyone who wants to help with that effort will participate using the various avenues we have created.