Sponsors

Showing posts with label custom. Show all posts
Showing posts with label custom. Show all posts

How to create your own Firefox theme


Share/Save/Bookmark

With a seemingly endless collection of add-ons, extensions and extras, Firefox is one of the most customisable browsers. But you can take your customisations even further by changing the graphics and adding your own add-ons and extensions.

We'll start by customising the graphics of a typical Firefox skin. Because there are hundreds of graphics files in a typical skin, a complete makeover can take a day or two. Smaller tweaks are much simpler, however, and we'll explore a couple of simple ways to create good-looking graphics.

Themes are supplied as '.jar' files, which are really renamed zip files. You'll find several directories inside: Browser, Communicator, Global, Help and Mozapps. There may also be a directory called Aero that duplicates some of these; effectively it's a separate collection of files and directories that's only used by themes running on Vista. Elsewhere, Browser is the most important directory for customisation because it includes the most obvious graphics and some of the CSS. The Global directory includes CSS files that define the layout of the different browser windows, and Mozapps and Help define the look and feel of the Help dialog and the browser extras, including the Extension Manager and Update Wizard. Customised themes also contain extra files, including 'preview.png' – a preview of the skin.

It's essential to update the two manifest files – 'contents.rdf' and 'install.rdf' – in our new theme, even though we haven't changed anything else. These files pass essential information to Firefox about the contents of the theme, including the name, compatible version numbers, author details and so on. There's a template for contents.rdf here. Copy this to a text editor and then do a global search and replace to change 'My_Theme' to a name that you've chosen yourself.

Similarly, you can find a template for install.rdf here. You can add additional author information here and also define the versions of Firefox that your new theme works with. The one minor complication is that you'll need to fill in a custom UUID in the field. Use the UUID generator to generate this and paste it into your edited version of install.rdf.

Customise the theme

Now that you know how to put together the bare bones of a skin, we can start making some creative changes. Look in the browser directory for the files 'toolbar.png' and 'toolbar-small.png'. These include all of the main toolbar buttons arranged in a grid. The reason why there are so many copies is to show the buttons in different states – normal, pressed, disabled, hover and active.

The easiest way to create replacements is by using layers. Photoshop is ideal for this, but tools like GIMP will work too. On one layer, you create the basic shapes. Higher layers can alter their colours: lighting up a button when the user moves their mouse over it or desaturating it if it's disabled, for example. This means that you only have to draw your icons once, and it's much easier to ensure consistency between buttons. Other effects that can work well include giving the buttons a plastic look with a sweep of translucent white around the top and a darker sweep around the base, or boosting the outlines to make them look set into the interface instead of just floating over it.

For now, just do something obvious but simple to see it in action: alter the buttons' hue in your art package of choice. For the time being, resist the urge to change any of the icon sizes. These are controlled by the CSS files packaged with each theme, and strange things will happen if you don't update them properly.

Repack the file back into a zip file but change the extension to '.jar'. Install it like any other skin and you should see your modified toolbar. If you want to, you can now rework the other toolbar buttons. Colour changes are fast, simple and rewarding. Because button design is difficult if you're not artistic, another quick cheat is to download a selection of skins and assemble a custom collection of other people's button designs into a unique toolbar of your own. This is fine as long as you don't distribute the toolbar.

But what about the CSS? There's a lot of it, but a quick way to find the links between the various image files and the CSS placeholders that define where they appear in the browser frame is to do a global search. If you edit the 'browser.css' file, it's easy to see where the toolbar graphics fit in, and it's also easy to change the size and position.

You can take the CSS much further by changing background colours and other basics, but this is where updates can become more complicated. To create a coherent look you'd need to change all of the elements, which would take a while. It's easier to use a supporting add-on like AnyColor to work out a colour scheme and then work on the detailed graphics later.

Customising the code

So what about customising the code? Nothing matches the satisfaction of getting your hands dirty, but there are good reasons not to – not least of which is that the build process isn't straightforward. For Windows developers, the instructions on the Simple Build page don't work. The build system uses an awkward combination of Gnu Make and MS compiler tools, and both of these environments have severe dependency issues.

The Windows dependencies at least seem to have been listed properly, so Visual Studio Express should give you all the libraries you need, but on the Gnu side you'll need a full version of Gnu for Windows that includes MinGW and MSYS and extra libraries such as GTK+ before the Configure tool will spit out a working collection of Make files.

If you look at the Linux Build prerequisites, the list of extras you need for Windows is similar. You can find most of the extra DLLs here.

Copy the binaries either to your Windows System32 folder or the main Binfolder in the Mozilla Build directory. The rest will need to be installed by hand. Where Windows binaries aren't available, build them from scratch.

A far easier alternative is to use Greasemonkey, an extension that adds customisable scripts to specific web pages. If you wanted to, you could mash up Google's services so that your Mail and Calendar are on the same page. A good Greasemonkey script can add features to a site long before its original creators get round to it, and integrate them so well that onlookers won't realise that there's anything extra going on.

To learn Greasemonkey scripting, take a look at the code for the free scripts available here. Platypus is a WYSIWYG front end (for an up-to-date version install it from the Firefox add-on pages) that lets you selectively remove or modify elements from pages through a point-click menu full of options. It's easy to remove specific ads and logos, and more skilful coding would make it possible to killfile posts from certain posters in an online forum. It's a good idea to use Platypus for crude selection as a front-end processor, and then combine it with more detailed Greasemonkey coding for more sophisticated effects.



--------------------------------------------------------

If you like this post please Bookmark it and comment bellow. To recieve new updates and other posts like this please subscribe via RSS or via Email.

Recent Articles:

--------------------------------------------------------

Share/Save/Bookmark

10 really cool Google Chrome hacks


Share/Save/Bookmark
Get the most from Google's browser with our handy guide

Google's Chrome browser is fast becoming the geeks' choice, as users all over the world tinker with it and explore its deeper capabilities.

Not lacking essential functionality, Chrome is now proving that it can do everything: from starting in Incognito mode by default for better browsing safety to reverting to using a single process for all its tabs to conserve resources. It can even make the images on a web page swirl and dance around like crazy, if you fancy something different.

The range of useful modifications that you can make to get Chrome just how you want it is extremely diverse “ made all the more expressive by its blindingly fast V8 JavaScript engine. From simple parameter changes to complex applets, here are 10 handy hacks to whip Chrome into shape.

1. Get more Omnibox suggestions

When you enter a search term into Chrome's Omnibox URL bar, it creates a pull-down list of suggestions for matching sites. However, this is limited to a maximum of five sitesby default, which is a bit restrictive. This hack lets you increase that number.

Right-click on the Chrome icon (even the one on the Windows Start menu) and select 'Properties'. In the resulting window, find the Target text box, add a space at the end of the line and the following text:

-omnibox-popup-count=30

This will extend the dropdown menu to 30 items, but you can change this to suit your needs.

2. Remove just your recent surfing history

The sites you've been visiting will be suggested in the browser's Omnibox. This can pose a problem if you share your PC with other people. If, for instance, you've been looking for a present for someone, it could spoil the surprise. You could clear the browsing data, but this will clear out everyone else's history, too. You could temporarily switch to Incognito mode to ensure that no search data is recorded, but if you forget, you have the same problem.

However, a small, free utility called Google Chrome Backup (GCB) by Pharelia Tools lets you create a backup of your browser's profile and restore it again later, thereby rolling back Chrome's search history to the point at which you backed it up. To use the utility, open its zip file, extract 'gcb.exe' and run the executable.

Using the program to cover your tracks is very simple. Before you begin surfing, press the 'Run Wizard' button. A second window will appear. Ensure that 'Backup' is selected and press 'Next'. Select the default profile and press 'Next' again. Browse for somewhere to place the backup of the default profile (a USB key, for example, on which you could also conveniently store GCB for use on public PCs), and press 'Back up'. The backup takes a second or two, but you'll have to close the window by hand.

After you've finished your confidential browsing session, to roll back the profile (thereby removing just your recent browsing history for this session), run GCB again; press the 'Run Wizard' button, select 'Restore' and press 'Next'. Browse for your saved file and press 'Next' again. Make sure that you're restoring to the default profile, press 'Next' again and finally hit the 'Restore' button. You'll be asked to confirm the procedure, after which the backup will be restored.

3. Use Stumbleupon

Stumbleupon is a great service for generating ideas or simply wasting an hour or two finding cool things. There's no plug-in for Chrome, but that's not a problem.

Right-click on the Bookmark bar and select 'Add page'. Give your new bookmark a suitable name “ 'Stumble', for example “ and enter the following JavaScript into the URL field:

javascript:window.location.href = 'http://www.stumbleupon.com/demo/#url';

When you want to use the site, simply hit this bookmark and the Stumbleupon homepage will open.

4. Read RSS feeds

One of the overwhelming disappointments about Chrome when it was released was its lack of an integrated RSS feed reader. Google seems to have assumed that everyone would use its standalone web-based Reader offering instead. Now, however, developer Ricardo Ferreira has written a script that conveniently sits behind a bookmark in the Bookmarks bar and allows users to read RSS feeds directly.

To prepare to use the script, in Chrome go to www.feeds.ramisp.org. Drag the piece of text that says 'Auto-Detect RSS' to the Bookmarks bar. This creates a bookmark containing a special JavaScript function.

Now surf to a site with an RSS feed. Press the Auto-Detect RSS bookmark and the site's main feed will open for you in the ramisp.org website. At the top of the page, you'll also see a range of options where you can subscribe to the feed using Yahoo!, Google, Pageflakes or Netvibes.

5. Explore Chrome's 'About:' pages

If you need to know what's going on deep inside Chrome, there's a special URL that you can use to get all the information you'll ever want about the browser and its performance.

In the Omnibox, enter the word 'about:' without the quotes but with the trailing colon. You should see some basic information about the browser's build, the V8 JavaScript engine and so on.

To see how well the browser's DNS pre-fetching system is currently working, enter 'about:dns' into the Omnibox and hit [Enter]. Pre-fetching is a technique used to speed up DNS domain resolutions. Beware, however, because until you close the browser – even if you think that you've cleared your browsing history – this DNS information remains, including the names of all the domains that have been pre-fetched.

For a demonstration of why it's a good idea to clear Chrome's cache completely, enter the URL 'about:cache'. The URLs of every page and every page element that the browser has ever cached will appear – and they're clickable. You would think that this data would be deleted when you clear the browsing data. However, if you select 'Clear browsing data...' on Chrome's Customise menu (the spanner icon), many people don't realise that the Time Period pull-down menu on the resultant pop-up is set to 'Last day' by default. Select the option to delete everything and the cache will clear completely.

For a bit of fun, try entering 'about:internets' and Chrome will run the Pipes screensaver inside itself. (If you're wondering what that's all about, it's a satirical reference to US Senator Ted Stevens' description of the internet as "a series of tubes".)

6. Start browsing in Incognito mode

Chrome has the very useful ability to save a bookmark to the desktop, Start menu or taskbar for later re-use. However, if you're not already in Incognito mode before surfing to the web page and saving it as a bookmark, you can't later start the bookmark in Incognito mode.

To change this, locate the bookmark and right-click on it. Select 'Properties' and at the end ofthe Target text box, add a space and type '-incognito' (without the quotes). Now double-click on the bookmark and it'll open in the distinctive, slate grey Incognito mode. You can also right-click on Chrome in the Start menu and add this keyword to the end of the Target line in its own Properties page to start the entire browser in Incognito mode.

7. Change Chrome's process model

Let's face it; Chrome's internal multiprocess architecture makes it very heavy on virtual memory. It's designed to be robust enough to run the next generation of Web 2.0 applications, and that means acting a little like an operating system. By default, Chrome consists of multiple processes, but if you're only using it for routine surfing duties, there's little point wasting all that extra memory and CPU time, even if you've got a fairly up-to-date PC that can handle the extra load.

Behind the scenes, Chrome can run in three processing modes. The most efficient of these is single process mode. To use this mode, open Chrome's properties in the Start menu and add the string '-single-process' (without the quotes) to the end of the Target box. Now, no matter how many tabs you open, the browser will use just one process.

If you add the string '-process-per-site' to the Target line, Chrome will open a new process for each tab, but if you open the same site in two tabs, it will run them on the same process. The string '-process-per-tab' will force Chrome to create a completely new process and use a new memory space for each tab, which is its default.

8. Download YouTube videos

While other browsers need a plug-in to download YouTube videos, Chrome can do the same with a small piece of JavaScript. Simply right-click on the bookmarks bar and select 'Add page…' Call it 'Download Video' and enter the following JavaScript on one line in the URL box:

javascript:window.location.href = 'http://youtube.com/get_video?video_id=' + swfArgs['video_id'] + "&l=" + swfArgs['l'] + "&sk=" + swfArgs['sk'] + '&fmt_map' + swfArgs['fmt_map'] + '&t=' + swfArgs['t'];

Now, go to a YouTube page and set a video running. Then, click on 'Download Video' to download it. The progress is displayed in a bar at the bottom of the browser window, but if you press [CTRL]+[J] you'll open a tab containing the download history.

One word of warning, though. The downloaded files are stored with the file name 'get_video' with no extension. Rename each with a sensible name, and give it the extension '.flv'. If you don't have any software that is able to play '.flv' files, you can download the free VLC Media Player.

9. Compare browser resource use

If you're not sure which of your browsers is using the most resources, there's a very simple way to see this information in Chrome, regardless of which browser you want to examine.

Simply hold down [Shift] and press [Escape]. This starts Chrome's internal task manager. If you now click on the 'Stats for nerds' button, a new tab opens and displays memory usage information for all running browsers, regardless of type. The lower part of the page also gives detailed information about individual Chrome processes. You can lose the task manager for a better view.

10. Make images dance

Here's an entertaining hack: it makes the images dance around in formation.

First, go to a web page containing plenty of images – a Google image search, for instance, or the display of your most visited sites. Delete everything in the Omnibox and enter the following JavaScript as a single line:

javascript:R=0;
x1=.1; y1=.05; x2=.25;
y2=.24; x3=1.6; y3=.24;
x4=300; y4=200; x5=300;
y5=200; DI=document.images;
DIL=DI.length;
function A()setInterval('A()',5); void(0);

When you press [Enter], the madness begins. To stop it again,hit the 'Refresh' button.



--------------------------------------------------------

If you like this post please Bookmark it and comment bellow. To recieve new updates and other posts like this please subscribe via RSS or via Email.

Recent Articles:

--------------------------------------------------------

Share/Save/Bookmark