XPath Testing Using Firebug

If you use Selenium, or some other web testing tool that can use XPath for element selection, Firebug provides a handy tool for testing.

In the console, it adds a new function $x. It takes an xpath as a parameter, and will return the item (or items) that match the xpath. You can then hover over the returned result to verify that the item you’re looking for is the one selected.

If you’re on Windows and use Firefox, look for this

Just read that a recent update pushed out by MS adds a serious vulnerability to Firefox. The Microsoft .NET Framework 3.5 Service Pack 1 also installs an add-on in Firefox. You may have noticed the add-on if you’ve recently looked in your Firefox add-ons dialog.

Just read an article that I unfortunately don’t have difficulty believing. This add-on adds ‘One-Click support and the ability to report installed .NET framework versions to the web server’.

Reading the article linked below, it appears this really means ‘a web page can install something without notifying the user’.

Here’s the article explaining the risks, and how to uninstall the add-on.

And I found an interesting comment at the bottom of the article…

(And if you’re thinking, “Why not just use a Mac,” may I remind you of the MobileMe junk recently installed on so many Windows machines without their owners’ permission!)

Web Development Tools

For debugging javascript, viewing the DOM by selecting items, seeing the style applied etc, here are 2 great tools.

  1. For Firefox, check out Firebug

2. For IE, check out Internet Explorer Developer Toolbar

Firebug is more powerful, but at least if you want/need to check something in IE, there’s an option.

Why would you care? The first time I used it was for stylesheet changes. Imagine you’re modifying a stylesheet but the element isn’t getting the style. Open the document in Firefox, inspect it, and you can see the styles applied in order, and by file. It will also show those that are defined, but are overridden at a higher level.

Ever wanted to test some javascript against a page, but don’t want to have to keep modifying the source page? Again, open up Firefox and enter the javascript in Firebug. It runs it right there, and shows the results. Once you get it correct, you can cut-and-paste it into your code.

Firefox – about:config settings I like

browser.tabs.closeButtons [Integer] – 2 so no close buttons appear. Use middle-click on tab to close it

browser.urlbar.hideGoButton [Boolean] – true. I never use it, so why have it taking up space?

keyword.URL [String] – ‘http://www.google.com/search?&q=’ . When set to this, typing something that isn’t a URL into the address line automatically goes to google and does a search.

browser.tabs.loadFolderandReplace [Boolean] – false. When open a group of tabs, won’t replace tabs already open in browser.

Firefox extensions – latest list

My list of Firefox extensions as of today.

Tab Mix Plus – Gives much better control over Tab appearance and functionality, as well as including a Session Manager. Well worth the download

FireBug – For all your web page development tasks. CSS, Javascript, Ajax development. Layout problems etc. Well worth checking out and installing if you do ANY web page development with CSS or Javascript.

Download Manager Tweak Extension – Allows the download manager to be opened in a tab, and a few other minor enhancements.

Image Zoom – for zooming in and out on images.

Feed Your Reader – Will re-direct RSS feeds to your favourite reader. I use this to ‘feed’ them to Feeddemon

IETab – If you want to open a window in Firefox, but it really needs IE, then this extension is for you. Used the IE control inside a Firefox tab.

CSE HTML Validator – if you use the CSE HTML Validator, this plug-in lets you use it on a loaded page. Can have it validate all pages you load, or only when you do a View source. Note, the plug-in works with the free version too.

Old:

Web Developer Extension – Essential if you do any web development. Allows for quick selection of information, and selective control over stylesheets, cookies and other items related to web page design.

Image Zoom

Allows for easy zooming of images. Firefox (and other browsers) allow ‘zooming’ on text (i.e. making the text larger) via the view menu, and this extension provides something similar for images. Now you can zoom in on an image to see it larger. Obviously if you zoom too much, the quality degrades, but I find this feature handy.

The homesite for this extension is here

Tabbrowser Preferences

Provides even more level of control over how new windows will be created. Firefox 1.0 added some of this by allowing you to tell it to create new windows as new tabs instead, but Tabbrowser Preferences takes it to the new level. I have it set to open all new windows as tabs instead, in the background and have Firefox hopefully not take focus from the program that sent it. This allows me to click on links in email newsletters without having Firefox come to the front, but also without having to manually create a new tab for each one. I can now open all the links I’m interested in, and read them later.

And here’s the link.

Firefox Tuning and Customization

Reading through my latest CPU magazine, and noticed some tips for Firefox. The biggest thing I miss from Mozilla is the Google search from the address line. After reading the article, I now know how to implement this feature in Firefox, and it’s even faster to use than in Mozilla.

By default, if a non-URL entry is put into the address line of Firefox, it will display the first entry from a Google ‘I Feel Lucky’ search. If you want it to do a standard Google Search, then first, put ‘about:config’ in the address line and press enter.

Scroll down until you find ‘keyword.URL’. Change the setting to ‘http://www.google.com/search?btnG=Google+Search&q=.’

Restart Firefox and enter something that doesn’t look like a URL. You should be presented with a Google search using the words you entered as the keywords.

Also in the article was a reference to this forum topic:
Firefox Tuning – MozillaZine Forums

The article discusses potential performance improvements by making changes to various other items in about:config. Also included is sample entries that can be cut-and-pasted into your prefs.js file in your profile directory. On XP, this is under Documents and Settings{user name}MozillaFirefoxProfiles{some keyname}. You will see a file called prefs.js. If you copy the suggested lines into this file, and restart Firefox, you should/may notice performance improvements.

If it doesn’t work, or it appears to be causing problems, you can always remove the lines from your prefs.js.

I’ve put them into mine, but haven’t done any testing as of yet, so please be cautious!