Posts Tagged ‘cck’

CCK Wizard Update and FAQs

Wednesday, March 3rd, 2010

I’ve updated the CCK Wizard for Firefox 3.6. It’s available here. It will be on AMO once the translations are done and if no one finds any major issues. Here’s a summary of the changes:

  • Updated for new Firefox 3.6 proxy panel
  • Two CCKs can now coexist (Company Identifiers must be unique to each CCK)
  • Bundling XPIs and JARs no longer uses XPI bundles – they are explicitly installed upon first run of the CCK (please test this if you bundle multple XPIs)
  • All translated CCK Wizards should now be working
  • First run screen added to CCK Wizard install
  • A few bugs fixed

Some other items of note:

As I mentioned before, I’ve moved CCK Wizard development to Google Code. Please feel free to open up bugs there.

Going forward, I’m going to add the ability to do more locking down of functionality in Firefox. If you have specific needs, please open bugs in Google Code.

To close this post out, I want to answer a couple questions about CCK Wizard that are asked a lot.

What is the right way to install the CCK?

There are multiple ways the CCK can be installed based on your needs. I’ll go through all those ways.

Standard install – The XPI that is created by the CCK Wizard is just a Firefox extension, so as such it can be placed on a web page and users can simply click to install. You can get more information on how to do this from the Mozilla developer center.

In the Firefox directory – Extensions can be installed directly into the Firefox directory. Inside of the directory where the Firefox executable is located, there is a directory called extensions. Inside this directory, you can create a directory with the same ID as your CCK and then unzip your CCK into that directory. This is the only location where you can hide the add-on.

As part of a Firefox install – I’ve previously documented how to bundle the CCK in the installer and how to package the installer on Windows. These instructions still hold true.

Globally – There are designated locations in different operating systems where extensions can be installed and they are picked up by Firefox. You can get more information on these locations at the Mozilla Developer Center. This involves unzipping the CCK package in a specific location on the users hard drive into a directory that is named the same as the ID of the CCK. Using this method, you can manage the CCK package centrally and the user cannot uninstall the CCK from Firefox.

Via the Windows Registry – If you are on Windows, extensions can be installed via the Windows registry. This is documented at the Mozilla Developer Center. This involves unzipping the CCK package that you created to a central location and then adding a registry key that tells Firefox where to find the CCK. Using this method, you can manage the CCK package centrally and the user cannot uninstall the CCK from Firefox.

What do the options “Do not show this extension in the extension manager” and “Prevent the uninstall of this extension” do? They don’t seem to work for me.

These options only work if your CCK is located in the extensions directory where the Firefox executable is located.

If you have any more questions, feel free to ask in the comments.

Do you need to do even more customization of Firefox for your organization? That’s what we do. Contact Kaply Consulting.

CCK Wizard Status

Thursday, January 28th, 2010

With the release of Firefox 3.6, people are already asking me about a new CCK Wizard. I am working on an update. You can get a beta of that here. Primary changes are more information on the proxy page, ability to open an existing CCK and better coexistence of multiple CCKs.

Most interesting news on the CCK front is that I’ve decided to move it to Google Code instead of maintaining in the Mozilla trees. The URL is http://code.google.com/p/ff-cckwizard/. My primary reason for doing this is honestly that I’m not really contributing to Mozilla/Firefox proper anymore and messing with Mercurial isn’t worth it for me (I know, lame excuse.) It has some other advantages, though, like having my own bug reporting system and not having to get any reviews/approvals for checkins.

So if you have ideas/suggestions/bugs for the CCK Wizard, please open them in Google Code.

Also note that CCK Wizard is something I do on the side, so my time is limited. Contributions help. I know there are a lot of folks who depend on this for the business. Any and all love is appreciated.

I Couldn't Stay Away From the CCK

Wednesday, February 11th, 2009

So it just so happens that some of the work I’m doing before I leave IBM involves the CCK, so I ended up working on it and fixing some bugs. In addition, a company asked for a feature that was pretty easy to implement. So here for your testing pleasure is:

CCK Wizard version 1.2.5

Here’s a summary of what’s changed:

  • Dropped support for Firefox 2
  • Added support for specifying sites where cookies are always allowed
  • Added support for specifying sites to deny popups/installs/cookies
  • Rewrote CCKService XPCOM Component to be a little cleaner
  • Fixed problem where sometimes a created CCK wouldn’t install (ZIP path problem)
  • Fixed problem where sometimes bookmarks weren’t created on first load
  • Fixed problem where bookmarks weren’t created in the same order as specified in the CCK Wizard
  • Made the additional help menu look better on Mac

Enjoy!

CCK Wizard 1.2 Finally Available

Friday, January 16th, 2009

The CCK Wizard for Firefox 3 is finally available. I had been holding off trying to get some translation work but finally gave up. You can get it from amo:

CCK Wizard 1.2

Enjoy!

Customizing Firefox with the CCK Wizard

Wednesday, June 11th, 2008

New version with fix for search engines not working.

FYI, I’m making a beta of the CCK Wizard available today for Firefox 3.

If you are deploying Firefox in your enterprise, educational institution, or even your household, you’ll want to check out the CCK Wizard (info at that link is a little dated right now).The CCK Wizard is an implementation of the old Netscape CCK that allows you to customize various aspects of Firefox and then contain all of those customizations in a single Firefox extension. Here are some of the things you can do

  • Add an identifier to the user agent string
  • Change the default home page and startup override home page
  • Change the title bar text
  • Change the animated logo
  • Add a web page and tooltip used for the animated logo
  • Add a help menu item that links to a web page
  • Provide sites for which popups and XPInstalls are allowed by default
  • Preinstall browser plug-ins
  • Preinstall search engines
  • Change the default search engine
  • Add folders, bookmarks and live bookmarks to the personal toolbar
  • Add folders, bookmarks and live bookmarks to the bookmarks folder
  • Set default preferences
  • Lock preferences
  • Add registry keys (Windows only)
  • Add certificates (See NOTE below)
  • Set default proxy configurations
  • Package other XPIs with your distribution
  • Disable about:config

Note that if you customize Firefox using the CCK Wizard, there are certain restrictions on redistribution outside of your organization, especially if you add certificates. Read the Mozilla Foundation Trademark policies for more info, or contact licensing@mozilla.org.

And please let me know if you find any bugs.

Simple Firefox Customizations: What Else Can I Do?

Monday, January 21st, 2008

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 browser-menubar.inc 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 browser-sets.inc. Searching through this file, we find: By simply adding this line to our overlay: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, browser-context.inc. Here we see that the ID for the view source item on the context menu is context-viewsource so we can just add to our overlay. OK, one last thing. Let’s remove the actual View Source menuitem. Looking in browser-menubar.inc we see: 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:



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 browser-menubar.inc 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?

Tuesday, January 15th, 2008

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 browser-menubar.inc. 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 browser-menubar.inc. 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

Friday, January 11th, 2008

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.

Simple Firefox Customizations: Using the CCK XPI

Monday, January 7th, 2008

Now that we know the basics of XUL Overlays, we’re going to look at using an existing CCK XPI to make our changes. The reason we’re using the CCK XPI is because we want to take advantage of code that has already been written for us. We’ll start by examining the contents of an XPI created by the CCK Wizard. Note that for this example, we’ve used the CCK Wizard to create an XPI that has no customization at all. We’re just going to add our new modifications.

After creating an XPI using the CCK Wizard, copy unzip that XPI into a directory. You’ll see the following files:


chrome/cck.jar
components/cckService.js
defaults/preferences/firefox-cck.js
chrome.manifest
install.rdf
install.js
cck.config

The two files that are important to us are chrome.manifest and cck.jar. Here’s that the manifest file looks like:


overlay chrome://browser/content/browser.xul  chrome://cck/content/cck-browser-overlay.xul
style   chrome://global/content/config.xul    chrome://cck/content/cck-config.css
content cck     jar:chrome/cck.jar!/content/cck/

This file defines the overlays we talked about earlier. We are overlaying a file called cck-browser-overlay.xul onto the regular browser XUL file and we are overlaying a new CSS file. We won’t modify the manifest right now since it has exactly what we need. Later we’ll need to make changes when we want to anything other than the main browser UI.

The next file that is important to us is cck.jar. This is a ZIP file that contains the XUL overlay files. After unzipping this file, you’ll see cck-browser-overlay.xul. This is the file where we are going to make our modifications. For now, lets do something similar. Edit the file cck-browser-overlay.xul and add this line before the <stringbundleset> section (we’ll get into the specifics of this change in the next installment).




Once you’ve made this change, zip the JAR first and then zip the XPI file. Next, install the XPI.

If everything worked correctly, when you look at the Tools menu, the Options… menuitem should be disabled.

What we’ve seen in this installment is that by modifying an existing CCK XPI, we can start customizing the Firefox UI. We didn’t have to write our own extension from scratch. In our next installment, we’ll look at the interesting things we can do in our browser overlay.

Simple Firefox Customizations: The Basics

Thursday, December 27th, 2007

I get asked a lot of questions about customizing Firefox that are beyond the scope of the CCK. Most of these questions involve how to prevent users from doing certain things or hide certain options in the UI. My typical answer is “you can write an extension for that,” but most people don’t want to go through the hassle of figuring out how to write an extension for what in most cases is a very simple change.

To try to address these issues, I’m going to do a series where I answer questions related to making simple changes to Firefox that might be needed in an enterprise environment. My goal is that a person with no extension experience at all will be able to make these changes by simply modifying an existing CCK extension.

Before I get into the specific customizations, I’m going to start with a very high level view of how we are going to make these changes.

Let’s define some terms in case you don’t know them. XUL (pronounced “zool”) is Mozilla’s XML-based User interface Language. It is used along with JavaScript and CSS to create the user interface in Firefox. Extensions can modify XUL, JavaScript and CSS by overlaying new XUL, JavaScript and CSS that replaces what is built-in to Firefox. Most of our work is going to involve the creation of these overlays. If you want more details, check out XUL Overlays at the Mozilla Developer Center.

There are currently two changes that the CCK makes using XUL overlays – adding a menu item to the Help menu and chanding the icon, link and tool tip for the animated icon (sometimes called the throbber). Both of these involve knowing the ID of the item you want to modify and then writing XUL that either modifies or replaces the existing XUL.

Here’s the XUL Overlay for adding the Help menu item:



  
  


In this case, we needed two IDs – the ID of the help menu (menu_HelpPopup) and the id of the item after which we want to insert our menu (aboutSeparator). What this overlay says is “in the menupopup with an ID of menu_HelpPopup, insert a new separator after the exisiting item aboutSeparator, then insert a new menuitem after that old separator as well.” Don’t worry about the different attributes – we’ll cover those later.

We can also use a XUL overlay to replace content. Here’s the overlay for the animated icon:


In this case, we needed the id of the existing animated icon (navigator-throbber) and we used our XUL to actually change the animated icon. We changed it from being disabled, we added tooltip text, and we added functionality when it is clicked.

Now that you have a very basic sense of how XUL overlays work, next we’re going to take a look at where in an existing CCK XPI our new overlays are going to be placed.