Archive for the ‘Mozilla Firefox’ Category

New Firebug extension: Firescope

Thursday, January 29th, 2009

Firescope

One Firefox add-on that I’ve been playing around with recently is Firescope from SitePoint.

Firescope is an extension to Firebug, which is one of the most useful tools for debugging websites, and essentially adds reference material for HTML and CSS to Firebug.

Firescope within Firebug window

It shows you code examples of all HTML and CSS elements, how well the various browsers support it (Full, Partial, Buggy or None), and gives you links to more detailed information about each element on the SitePoint reference sites:

This is a welcome addition to Firebug, and will certainly save me time checking the exact syntax of those HTML and CSS elements that I don’t use very often. Even though I have the SitePoint Ultimate Reference guides to HTML and CSS both on my desk at work, and in PDF format on my desktop.

Firebug bug

Thursday, June 19th, 2008

Firebug

Today I spotted a bug with Firebug 1.2.0b3 in Firefox 3.0. Here’s what I posted to the Firebug Google Group:

I’ve just upgraded to Firefox 3.0 (on Windows XP Pro) and have installed Firebug 1.2.0b3 but I’m having an issue with Firebug not responding once it has been opened in its own window. My colleague is experiencing the same issue, which we can repeat again and again, (which is reassuring that it’s not just me).

The issue seems to (sort of) resolve itself once the page has been refreshed (either in Firefox or Firebug), but this is certainly different behaviour from Firebug in Firefox 2.0.x.

Here’s what we do:

  1. Right-click on a page element and select “Inspect Element” from the context menu.
  2. Firebug opens in a panel at the bottom of the Firefox window.
  3. As expected the HTML tab is selected and if I hover over the tag elements in the left-hand pane it highlights those elements on the web page within Firefox. I can also open or close the various nodes by clicking on the [+] and [-] buttons.
  4. Now if I click the red icon at the right of the Firebug panel to “Open Firebug in New Window” the Firebug panel ‘leaps’ out of Firefox and appears in its own window, however, the functionality described above is now disabled: hovering over the HTML elements in the Firebug HTML pane no longer highlights anything within Firefox, and the [+] and [-] node buttons are now unresponsive. What does still work, however, is the bar beneath the menu bar in Firebug, the bar that begins: “Inspect Edit |”.
  5. If I then refresh the page in Firefox the functionality in Firebug is restored. Similarly, if I select View > Reload in Firebug.
  6. Now if I close the Firebug window, and then begin again by right-clicking something on the page and select “Inspect Element” Firebug opens in a panel at the bottom of the Firefox window but now everything is ‘frozen’ in the HTML panel again until I refresh the Firefox page. Clicking on the [+] and [-] node buttons do nothing. The issue is not resolved if I open Firebug in its own window by clicking on the Firebug button on the toolbar, either.

This appears to me to be a bug.

Within 30 minutes I got a response:

Probably a bug, we don’t usually use the open-in-own-window ourselves so we break it sometimes without knowing.

So I’ve logged it on the Google Code fbug bug list: Issue 823: Firebug 1.2.0b3 unresponsive in Firefox 3 when opened in own window.

I do hope that it gets fixed soon, as I use that feature all the time. Such are the benefits of having three monitors at work, and two at home.

Mozilla Firefox 2.0.0.9 fixed our 404

Friday, November 2nd, 2007

Broken 404 page
Before: 404 Page shown in Firefox 2.0.0.8

404 page
After: 404 Page shown in Firefox 2.0.0.9

Remember that problem we had a couple of weeks back when we updated to Firefox 2.0.0.8: Latest version of Firefox broke our 404 page?

Well, it turns out that it was indeed a problem with Firefox 2.0.0.8. The good news, though, is that it’s now been fixed in Firefox 2.0.0.9, which was released yesterday (1 November).

There’s a good write-up about this on the Mozilla Developer News site: Firefox 2.0.0.8 update to be updated. I certainly appreciate their honesty:

The 2.0.0.8 release fixed some 200 issues, but accidentally regressed a few things. Most users won’t see any difference or experience any problems, and those 200 fixes make the 2.0.0.8 update very valuable, but you should never have to choose functionality over security.

Looks like it was this bug that broke our pages, including the University homepage: Bug 400406 – Layout badly broken in 2.0.0.8, CSS issue with floats or negative margins or display property…

Good work folks, at finding and eliminating the fix.

Latest version of Firefox broke our 404 page

Saturday, October 20th, 2007

Broken web page

The latest version of Mozilla Firefox 2.0.0.8, I’m sorry to report, broke a couple of our web pages yesterday.

UPDATE: This problem has now been fixed in Firefox 2.0.0.9: see Firefox 2.0.0.8 update to be updated

I noticed it just as I was about to go out for lunch. I was checking out a page on the University website and followed a broken link … to a broken 404 page.

Investigations

At first I simply suspected that it was due to some CSS tinkering that either my colleague or I had done. But neither of us had done any.

And then I discovered that it was working fine in Firefox 1.5, IE6, IE7, Opera 9 and Safari 3. It was working fine in my colleague’s installation of Firefox 2.0.0.7 … and then when he restarted the browser to allow its automatic update to version 2.0.0.8 it promptly broke.

So the culprit was indeed the latest incarnation of my favourite browser. How disappointing.

The problem

The way that the page is constructed is that there is a div that wraps the page’s main content. If I was recoding it today, I’d call it #contentWrapper; when I coded it 10 months ago, I called it #main.

Within #main there are three other divs, in order:

  1. #content
  2. #sidebar
  3. #related_content

#main then has a background image of part of the University crest. How much of the crest is displayed depends entirely on the height of its three internal divs.

Only, this appears to be the problem that Firefox 2.0.0.8 has highlighted/discovered/introduced* (*delete as applicable): it now does not recognize the height of the internal divs: #content, #sidebar and #related_content and so collapses, as you can see from the screenshot above.

The (temporary) fix

Introducing a min-height CSS attribute to the code has temporarily fixed the problem, but fixed the height of #main at 550px — enough for the 404, 401 and the front page, which all use that code.

Recoding

I’m now working on a more robust fix … in fact, I’m now working on recoding the entire site to make it more usable by the few ancient browsers that Google Analytics informs us are still being used to visit the site, such as Firefox 1.0, Firefox 1.5, and various older versions of Netscape and IE.

I had used a variation of Matthew Levine’s In Search of the Holy Grail method on A List Apart, mixed with a Dan Cederholm’s Faux Columns approach, for a number of reasons:

  1. I wanted the site to be as accessible as possible, and decided that placing the main page content as high in the source code as possible would be helpful.
  2. Do you know how difficult it is to achieve something as seemingly simple as creating a page layout with three equal-height columns?
  3. The ‘holy grail’ approach worked for almost everything we needed until it came to wanting to jump down to page anchors. We had a couple of A-Z lists and wanted to be able to click on ‘D’ to take us down to the ‘D’ entries. Instead, it pulled ‘D’ up to the top of the page and made A-C disappear completely!!
  4. We decided to fully support only modern browsers: IE6 and IE7, Firefox, Safari/Konqueror and Opera 8 and above. (While I don’t class IE6 as a modern browser it’s the one used on about 75% of all the university PCs so we had no choice but to support it.)

I guess I now need to be finishing writing these fixes sooner rather than later. I’m just a little disappointed that the latest version of my favourite browser has broken the code, while Safari, Opera 9 and even IE7 saw fit to render it as expected.

However, what I’m not entirely certain about is whether Firefox is now simply rendering the code as it should be (in other words, I’d missed a trick with my code) or whether this genuinely is a fault with Firefox’s rendering. Time will tell.

Firefox 3: It’s not going to format your hard drive or anything

Thursday, September 13th, 2007

Firefox - rediscover the web

There’s an interview with Tristan Nitot, the president of Mozilla Europe, on the PC Pro News website today.

When asked when we are likely to see the beta of Firefox 3 Tristan Nitot replied

Beta shouldn’t be too long, probably by the end of the year. We want it to be stable, usable. It will be, it’s not going to format your hard drive or anything.

And here was me hoping that that would be a feature.

Question

Which got me thinking: what would be the worst built-in or add-on features that you could think of for Firefox? Your thoughts in the comments below …

Essential web development tools for Firefox

Wednesday, September 12th, 2007

Firefox eats IEI was chatting with a friend online this evening (hello Steve!) about web coding, and I offered him my three favourite add-ons for Mozilla Firefox which I find absolutely essential for coding and debugging HTML, CSS and JavaScript.

Work in Firefox, debug in IE

When developing code I tend to always work with Firefox first. When I’m happy that my code is working properly, I’ll then test it in Opera and Safari and only then will I check it out in Internet Explorer 6 and 7.

And then typically I’ll spend the next fortnight debugging my nice clean code in IE, trying to find workarounds that will make my pages work properly in the world’s favourite (and most terrible) browsers.

It’s only the most popular because people are too lazy to install something better. Or don’t realise that there is something better. “But it looks okay to me…!”

Seriously, if there was a car that killed as many people as IE kills good quality web code, it would be banned in a flash.

1. Web Developer

Web Developer toolbar

Web Developer by Chris Pederick adds a toolbar and a new submenu to Tools to Firefox, which are absolutely packed with web developer tools.

There are 12 main sections on the toolbar, which give you access to all the tools and features:

  1. Disable
    Allows you to disable anything from Java to JavaScript, Cache, Meta redirects to colours.

  2. Cookies
    Disable, delete, clear or view cookie information.

  3. CSS
    Not only can you view CSS, you can also edit live CSS in the cache and see what effect your changes have.

  4. Forms
    Display form details, show passwords, change GETs to POSTs, etc.

  5. Images
    Disable or hide images, display alt attributes, image dimensions, etc.

  6. Information
    View all sorts of details about the page from ID and class information to blocks, anchors, links, tables, document size, headers and lots more.

  7. Miscellaneous
    Show comments, show hidden elements,show a ruler on the page, etc.

  8. Outline
    This is one of my favourites — here you can single out a particular page element and find out the markup, class and ID information. Essential for debugging or writing CSS.

  9. Resize
    Define preset page sizes for testing, eg 800 x 600, 1024 x 768, etc.

  10. Tools
    Validation, DOM inspector, Error and Java consoles.

  11. View Source
    View Source, Framed Source and Generated Source.

  12. Options
    Options, Help and About.

I use this add-on all the time, particularly for debugging code or learning about someone else’s code.

It is designed for Firefox, Flock, Mozilla and Seamonkey, and will run on any platform that these browsers support including Windows, Mac OS X and Linux.

2. Firebug

Firebug

Firebug offers a few similar features to Web Developer but it really comes into its own with its own separate window. Here you can explore the HTML, CSS, JavaScript, all viewable by DOM, Styles or Layout.

Two of my favourite features are the ability to point at a line of code in the Firebug source view and the corresponding section of the actual page is highlighted (check out the blue highlight in the screenshot above), showing you exactly what that code relates to on the finished page. It even shows margins and padding in different colours (yellow and purple).

It will also show you the CSS cascade: which CSS rules are being used for that section of the page, and which are being overruled.

Firebug will also allow you to edit HTML, CSS, and run live JavaScript on the cached page, making it one truly remarkable and powerful add-on to your web developing toolkit.

3. HTML Validator

0 errors / 0 warnings

HTML Validator is an add-on that shows HTML validation information within your Firefox browser window, rather than having to go to a separate site, such as http://validator.w3.org.

The number of errors of a HTML page is seen on the form of an icon in the status bar when browsing. The details of the errors are seen when looking the HTML source of the page.

It really is that simple. You can specify the type of validations to check, including accessibility.

Conclusion

Those are my top 3 web developer add-ons. Of course, Microsoft also has its own Internet Explorer Developer Toolbar, but to be honest compared with the polished and precise offerings for Mozilla, the IE version has the elegance of performing open-heart surgery with a wooden spoon and a spanner.

Other developer-related add-ons that I’ve used, include:

  • JavaScript Debugger – This is Mozilla’s official JavaScript debugger, code named Venkman, which aims to provide a powerful JavaScript debugging environment for all Mozilla based browsers.
  • View Source Chart (creates a colourful chart of a web page’s rendered source code, which can be very useful.
  • UrlParams – Shows you the GET and POST parameters of the current website in the sidebar, and allows you to edit and submit your own values. Useful for testing forms.
  • Operator and Tails – two add-ons for showing Microformats information .. but that’s for another blog post

I tend to keep most of these installed (apart from the Microformats add-ons) but disabled, and only enable them when I need them. That way they are close at hand, but don’t take up valuable system resources for the 99% of time that I’m not using them.

Firefox advert on YouTube

Monday, August 6th, 2007

I just stumbled upon this Firefox advert on YouTube. It made me laugh.