<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Seifi.org &#187; firefox</title>
	<atom:link href="http://www.seifi.org/category/firefox/feed" rel="self" type="application/rss+xml" />
	<link>http://www.seifi.org</link>
	<description>A Web Development Blog by Joe Seifi - seifi.org</description>
	<lastBuildDate>Thu, 12 Aug 2010 05:35:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Sniff and Disable Firebug Howto (Gmail example)</title>
		<link>http://www.seifi.org/javascript/sniff-and-disable-firebug-howto-gmail-example.html</link>
		<comments>http://www.seifi.org/javascript/sniff-and-disable-firebug-howto-gmail-example.html#comments</comments>
		<pubDate>Wed, 28 Nov 2007 20:02:38 +0000</pubDate>
		<dc:creator>Joe Seifi</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[firebug]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.seifi.org/ajax/sniff-and-disable-firebug-howto-gmail-example.html</guid>
		<description><![CDATA[Here is a simple test to see if users have Firebug installed on their browsers. Obviously this would also weed out non-FireFox users. if &#40;window.console &#38;&#38; window.console.firebug&#41; &#123; alert&#40;&#34;found Firebug&#34;&#41;; &#125;else&#123; alert&#40;&#34;can't find Firebug&#34;&#41;; &#125; Demo: Sniff for FireBug You may have noticed this message in your Gmail homepage recently: The reason for that is [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a simple test to see if users have <a href="http://www.seifi.org/firebug/firebug_tips_and_tricks.html">Firebug</a> installed on their browsers. Obviously this would also weed out non-FireFox users.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">console</span> <span style="color: #339933;">&amp;&amp;</span> window.<span style="color: #660066;">console</span>.<span style="color: #660066;">firebug</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;found Firebug&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
  <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;can't find Firebug&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><span id="more-608"></span><br />
Demo: <a href="javascript:if(window.console &#038;&#038; window.console.firebug){alert('found Firebug');}else{alert('can\'t find Firebug');}">Sniff for FireBug</a></p>
<p>You may have noticed this message in your Gmail homepage recently:<br />
<img src='http://www.seifi.org/wp-content/uploads/2007/11/gmail_firebug_issue.gif' alt='Gmail Doesn’t Like Firebug' /></p>
<p>The reason for that is Firebug by default logs all XMLHttpRequests made for all the websites you visit. The problem is that the data that is logged never gets disposed of or cleared out.  Therefore, FireFox having to collect and store that information and the memory for Firefox will eventually get large enough that will cause your computer to start using paged cache. This will then make Gmail seem like you are swimming through molasses. Gmail by default seems to make 22 XMLHttpRequests when I load the main page. It then makes a new XMLHttpRequest every 30 seconds, to check for new emails, so in the span of 1 hour you will have 120 new Ajax calls tacked on. This is a nice feature of Gmail which makes life simple for its users (Notice there is no &#8220;Get new mail&#8221; button anywhere). But now every new Ajax call is another 1kb of data which adds to the memory usage and tacks on more CPU and RAM consumed by Firebug.</p>
<p>No need to worry though since, another nice feature of Firebug is that you can disable it on a domain name basis. </p>
<p><img src='http://www.seifi.org/wp-content/uploads/2007/11/disable_gmail_firebug.gif' alt='How to disable Firebug for any domain name ex) mail.google.com' align="left" hspace="10" vspace="3" /> To turn off Firebug for mail.google.com first open Firebug by hitting the green icon or F12. Click on the bug icon in the top left and choose the second option labeled &#8220;Disable Firebug for mail.google.com&#8221;. Now Firebug will be turned off and the green icon will be changed to a silver icon for this domain. You should notice a smoother and faster Gmail experience. You can also turn it back on by clicking on the link &#8220;Enable Firebug for this website&#8221;.</p>
<p><img src='http://www.seifi.org/wp-content/uploads/2007/11/allowedsites.gif' alt='Allowed Sites…' align="right" hspace="10" vspace="3" /> The other and better method of speeding up your Firefox and still keeping Firebug around, is to disable Firebug all together and enable it for specific sites that you are working on. To disable Firebug, again you click on the Bug icon and this time choose the first option &#8220;Disable Firebug&#8221;.<br />
Now visit any site that you would like to use Firebug on and then &#8220;right click&#8221; on the silver icon on the bottom and choose &#8220;Allowed Sites&#8230;&#8221; From here you can add the domain name for any sites you want to override. This makes your life easier and makes general surfing faster in FireFox, yet allows for using the powers of the almighty Firebug when needed.</p>
<p>If your application is similar to Gmail where XMLHttpRequests are called in a loop you may want to use the sniff script to warn users to disable Firebug for your domain as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seifi.org/javascript/sniff-and-disable-firebug-howto-gmail-example.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Free Screenshot tools for web developers</title>
		<link>http://www.seifi.org/firefox/free-screenshot-tools-for-web-developers.html</link>
		<comments>http://www.seifi.org/firefox/free-screenshot-tools-for-web-developers.html#comments</comments>
		<pubDate>Wed, 27 Jun 2007 07:39:40 +0000</pubDate>
		<dc:creator>Joe Seifi</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.seifi.org/windows/free-screenshot-tools-for-web-developers.html</guid>
		<description><![CDATA[From time to time you need to capture a web site in the form of an image. While you can easily use the Ctrl+Alt+PrtSc for windows or Command+Shift+4 in Mac, you might want to screen a site that is tall and or wide and requires scrolling to fully view in your browser. You also might [...]]]></description>
			<content:encoded><![CDATA[<p>From time to time you need to capture a web site in the form of an image. While you can easily use the Ctrl+Alt+PrtSc for windows or Command+Shift+4 in Mac, you might want to screen a site that is tall and or wide and requires scrolling to fully view in your browser. You also might want to perform multiple screen captures of various pages in various web browsers or only grab sections of a page. Below is a list of Windows, OSX and Linux tools you can use to take browser based screenshots in FireFox, Internet Explorer and Safari.</p>
<p><span id="more-579"></span></p>
<p>While there are paid services such as <a title="http://www.browsercam.com/" href="http://www.browsercam.com/">Browser Cam</a> that do cross-browser screen captures, I tend to prefer using software since I can fine-tune the results to my liking, and I can see the results immediately.</p>
<h3><strong>add-ons via Firefox</strong></h3>
<p><a title="https://addons.mozilla.org/en-US/firefox/addon/1146" href="https://addons.mozilla.org/en-US/firefox/addon/1146">ScreenGrab</a> &#8211; This FireFox extension installs as an icon&nbsp;in the lower right corner of the he status bar.&nbsp; This plugin uses the Gecko <a href="http://developer.mozilla.org/en/docs/HTML:Canvas">canvas</a> for faster processing. IT allows for capturing either a selection, the visible window or the entire page. You can customize the options to save either a PNG or JPG image and add a timestamp to the filename, and captures frames and flash files sections without any problems.</p>
<p><a title="http://pearlcrescent.com/products/pagesaver/" href="http://pearlcrescent.com/products/pagesaver/">PageSaver</a>&nbsp;- This alternate extension from Pearl Crescent installs two new entries in the context menu of FireFox, allowing to save either the visibile portion or the entire page, although it does not allow for saving a selection. It has a&nbsp;slew of options however. For example you can assign a keyboard shortcut which is a great time saver.&nbsp; You can also set your image filename patterns and choose the format of the saved image. PageSaver can capture frames and flash files.</p>
<h3>Windows Software&nbsp;via Internet Explorer</h3>
<p><a href="http://www.websitescreenshots.com/">WebShot</a>&nbsp;- You may want to save the screenshot using IE for testing purposes in which case you need to use WebShot which is a tiny executable written in C by Nathan Moinvaziri. It is available in both a GUI format and a command-line format.&nbsp; WebShot is able to capture any URL and handles frames, and flash files and can also capture java applets. The processing time&nbsp;is somewhat slow for some reason however compared to the other tools. WebShot offers a ton of options when using its command line version.</p>
<h3>OSX Software via Safari</h3>
<p><a title="http://www.paulhammond.org/webkit2png/" href="http://www.paulhammond.org/webkit2png/">webkit2png</a>&nbsp;- is the official command line tool for the Mac which uses python and&nbsp;the <a href="http://webkit.org/">WebKit</a> rendering engine, which is used in Safari.</p>
<p><a title="Paparazzi" href="http://www.derailer.org/paparazzi/">Paparazzi</a>&nbsp;- If you need a simpler GUI try Paparazzi which is a great shell on top of webkit2png, making your life much easier. Paparazzi like PageSaver has many similar options you can set for your captured screenshot images.</p>
<h3>Unix Software</h3>
<p><a title="http://khtml2png.sourceforge.net/" href="http://khtml2png.sourceforge.net/">khtml2png</a> &#8211; is a great command line tool for Unix which uses <a title="http://www.imagemagick.org" href="http://www.imagemagick.org">ImageMagick</a> and libkhtml used in <a title="http://www.konqueror.org/" href="http://www.konqueror.org/">Konqueror</a> to create images from web pages.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seifi.org/firefox/free-screenshot-tools-for-web-developers.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FireBug Tips and Tricks</title>
		<link>http://www.seifi.org/javascript/firebug_tips_and_tricks.html</link>
		<comments>http://www.seifi.org/javascript/firebug_tips_and_tricks.html#comments</comments>
		<pubDate>Wed, 18 Apr 2007 07:57:19 +0000</pubDate>
		<dc:creator>Joe Seifi</dc:creator>
				<category><![CDATA[firebug]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[There is so much power packed into this little FireFox plug-in. It is truly a revolutionary tool for web developers. Here is a quick and dirty set of its most powerful features. To get started, open up firebug using F12 or by clicking its icon in the lower right corner of FireFox. To jump straight [...]]]></description>
			<content:encoded><![CDATA[<p>There is so much power packed into this little <a href="http://www.mozilla.com/en-US/firefox/">FireFox</a> <a href="http://www.getfirebug.com/">plug-in</a>. It is truly a revolutionary tool for web developers. Here is a quick and dirty set of its most powerful features.</p>
<p>To get started, open up firebug using F12 or by clicking its icon <img src="http://seifi.org/wp-content/uploads/2007/04/041807_0057_UsingFireBu1.gif" />in the lower right corner of FireFox. To jump straight to the console and start typing commands you can use the Ctrl+Shift+L keyboard shortcut.<span id="more-477"></span><br />
<img src="http://seifi.org/wp-content/uploads/2007/04/041807_0057_UsingFireBu2.gif" /></p>
<p>From here you can type commands. Try entering document. This will bring up the document DOM object and you can click on that link to get to the DOM and inspect all of the properties of the document object. A shortcut is also available by typing inspect(document) etc. You can use $ and $$ as in Prototype, such as $(&#8216;firebug&#8217;) and inspect($$(&#8216;.firebug&#8217;)). Use the up and down arrows to cycle through command history.</p>
<ul>
<li>Use console.log and sprintf formatting commands for debugging.</li>
<li>Use console.info, console.warn and console.error to set your debugging levels.</li>
<li>Use console.time to log the time your functions take to run.</li>
<li>Use the error console to view the stack trace of the errors.</li>
</ul>
<p>You can download <a href="http://www.getfirebug.com/lite.html">Firebug Lite</a> to make these methods work in Internet Explorer. I recommend that you remove your console commands before you go live.</p>
<p>Try <a href="javascript:consoleIntro()">Console logging</a> test using <em>console.log</em> You can use sprintf formatting here.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> consoleIntro<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <span style="color: #003366; font-weight: bold;">var</span> x <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;fubar&quot;</span><span style="color: #339933;">;</span>
 <span style="color: #003366; font-weight: bold;">var</span> y <span style="color: #339933;">=</span> <span style="color: #CC0000;">543</span><span style="color: #339933;">;</span>
 console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;value of x is %s and value of y is %d&quot;</span><span style="color: #339933;">,</span> x<span style="color: #339933;">,</span> y<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Try <a href="javascript:consoleLogLevels()">Console Error Levels</a> <em>console.info|warn|error</em></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> consoleLogLevels<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <span style="color: #003366; font-weight: bold;">var</span> a <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;This is an info level message&quot;</span><span style="color: #339933;">;</span>
 <span style="color: #003366; font-weight: bold;">var</span> b <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;This is a warn level message&quot;</span><span style="color: #339933;">;</span>
 <span style="color: #003366; font-weight: bold;">var</span> c <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;This is an error level message&quot;</span><span style="color: #339933;">;</span>
 console.<span style="color: #660066;">info</span><span style="color: #009900;">&#40;</span>a<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 console.<span style="color: #660066;">warn</span><span style="color: #009900;">&#40;</span>b<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 console.<span style="color: #660066;">error</span><span style="color: #009900;">&#40;</span>c<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Try <a href="javascript:timeThisTask()">Timer logging</a> <em>console.time|timeEnd</em></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> timeThisTask<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 console.<span style="color: #660066;">time</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Sample Timer&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>x<span style="color: #339933;">=</span><span style="color: #CC0000;">100000</span><span style="color: #339933;">;</span>x<span style="color: #339933;">&gt;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>x<span style="color: #339933;">--</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>
 console.<span style="color: #660066;">timeEnd</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Sample Timer&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Try <a href="javascript:void(0)" onclick="stack1()">Error Stack Traces</a> to see stack trace of the errors</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> stack1<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <span style="color: #003366; font-weight: bold;">var</span> d <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;fu&quot;</span><span style="color: #339933;">;</span>var e <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;bar&quot;</span><span style="color: #339933;">;</span>var f <span style="color: #339933;">=</span> stack2<span style="color: #009900;">&#40;</span>d<span style="color: #339933;">,</span>e<span style="color: #009900;">&#41;</span>
 console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> stack2<span style="color: #009900;">&#40;</span>d<span style="color: #339933;">,</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #000066; font-weight: bold;">return</span> stack3<span style="color: #009900;">&#40;</span>d<span style="color: #339933;">,</span>e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> stack3<span style="color: #009900;">&#40;</span>d<span style="color: #339933;">,</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #000066; font-weight: bold;">return</span> UndefinedVariable<span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span></pre></div></div>

<p><img src="http://seifi.org/wp-content/uploads/2007/04/041807_0057_UsingFireBu3.gif" /></p>
<p>Use the debugger to add breakpoints, debug JavaScript code and step through your code.</p>
<p>There are 3 ways to trigger the debugger:</p>
<ol>
<li>Use the debugger command.</li>
<li>Add a breakpoint by clicking on the line number</li>
<li>Enable the &#8220;Break on All Errors&#8221; option for the Script tab.</li>
</ol>
<p>Try a <a href="javascript:debugMe()">Deubgger Demo</a> using the <em>debugger</em> command</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> debugMe<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <span style="color: #003366; font-weight: bold;">debugger</span><span style="color: #339933;">;</span>
 <span style="color: #003366; font-weight: bold;">var</span> g <span style="color: #339933;">=</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
 <span style="color: #003366; font-weight: bold;">var</span> h <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">getMilliseconds</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000066; font-weight: bold;">while</span><span style="color: #009900;">&#40;</span>g <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  g <span style="color: #339933;">*=</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">;</span>
  h <span style="color: #339933;">-=</span> g<span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><img src="http://seifi.org/wp-content/uploads/2007/04/041807_0057_UsingFireBu4.gif" /></p>
<p><img src="http://seifi.org/wp-content/uploads/2007/04/041807_0057_UsingFireBu5.gif" /></p>
<p>Use the profiler to record detailed statistics on your Script calls and DOM events. This works very much like macros. To manually start profiling click on the profile button in the Console tab. Then try performing some actions on the page. When you are done click on the profile button again. A report is returned which captures the funtions that were called within that time period.</p>
<p>The report output data can be sorted. Own Time tells you how much time each function call took in milliseconds and as a percentage of the total time which can be useful in finding bottlenecks in your code.</p>
<p>Try <a href="javascript:profileMe()">Manual Profiler</a> test using the manual profile feature</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> profileMe<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 timeThisTask<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #003366; font-weight: bold;">var</span> timerlink <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;tabs&quot;</span><span style="color: #009900;">&#41;</span>.
       <span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">firstChild</span><span style="color: #339933;">;</span>
 <span style="color: #003366; font-weight: bold;">var</span> typeNode <span style="color: #339933;">=</span> timerlink.<span style="color: #660066;">nodeType</span><span style="color: #339933;">;</span>
 <span style="color: #003366; font-weight: bold;">var</span> nameNode <span style="color: #339933;">=</span> timerlink.<span style="color: #660066;">nodeName</span><span style="color: #339933;">;</span>
 <span style="color: #003366; font-weight: bold;">var</span> valuNode <span style="color: #339933;">=</span> timerlink.<span style="color: #660066;">nodeValue</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>You can also add profilers to your code via the console.profile(&#8220;foo&#8221;) &#8211; console.profileEnd(&#8220;foo&#8221;) function calls. This can be great when you want to track down events that happen onload.</p>
<p>Try the <a href="javascript:profiledFunction()">Coded Profiler</a> using <em>console.profile|profileEnd</em> command</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> profiledFunction<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 console.<span style="color: #660066;">profile</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Test Auto Profiler&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 timeThisTask<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 profileMe<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 console.<span style="color: #660066;">profileEnd</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Test Auto Profiler&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><img src="http://seifi.org/wp-content/uploads/2007/04/041807_0057_UsingFireBu6.gif" /></p>
<p>You can log calls to a specific function call and see what parameters are being passed to it and how many times it is being called. To do this open the script tab, find your function and right click within it. From the popup menu choose the &#8220;log calls to &#8220;function name&#8221;".</p>
<p><img src="http://seifi.org/wp-content/uploads/2007/04/041807_0057_UsingFireBu7.gif" /></p>
<p>Now whenever that function is called you get a nice message in the console along with the parameter values sent to it.</p>
<p>Try the <a href="javascript:callLoggedFunction()">Logged Function</a> test with logged functions</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> callLoggedFunction<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>x<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>x<span style="color: #339933;">&lt;</span><span style="color: #CC0000;">2</span><span style="color: #339933;">;</span>x<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>y<span style="color: #339933;">=</span><span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>y<span style="color: #339933;">&gt;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>y<span style="color: #339933;">--</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>loggedFuction<span style="color: #009900;">&#40;</span>x<span style="color: #339933;">,</span>y<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> loggedFuction<span style="color: #009900;">&#40;</span>x<span style="color: #339933;">,</span>y<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>y<span style="color: #339933;">&gt;</span>x<span style="color: #009900;">&#41;</span> console.<span style="color: #660066;">info</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;y is greater than x&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><img src="http://seifi.org/wp-content/uploads/2007/04/041807_0057_UsingFireBu8.gif" /></p>
<p>In the HTML tab you can also log events for specific elements. This can be useful when you are creating elements on the fly via the DOM and want to track all the events happening behind the scenes.</p>
<p>The Net tab is quite useful for tracing HTTP request and responses. Network traffic can be filtered by type (HTML, CSS, JS, Images, XmlHttpRequest). The Params tab is very handy and shows you the request parameters in a table format. This is great for tracing your Ajax requests. The issue with this that I found is that once a request is made which leaves the current page you loose the previous pages net events. Maybe a feature for the next version of FireBug?</p>
<p><img src="http://seifi.org/wp-content/uploads/2007/04/041807_0057_UsingFireBu9.gif" /></p>
<p>From the HTML tab you can use the Layout tab to view and edit any element&#8217;s offset, margin, border, padding and dimension values on the fly.</p>
<p>In the Style sub tab of the HTML tab you can choose an option to &#8220;Show Computed Style&#8221; which shows you the final style values of the selected HTML element. Another neat trick is that you can click on any CSS property and edit it inline in real time. You can use the up/down keys and page up/page down keys to change numeric values and see your changes in real time, for example padding etc.</p>
<p><script src="http://seifi.org/wp-content/uploads/2007/04/firebugtest.js"></script></p>
<p id="firebug"><span class="firebug"></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.seifi.org/javascript/firebug_tips_and_tricks.html/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Monkeying around with the Fox</title>
		<link>http://www.seifi.org/javascript/monkeying_around_with_the_fox.html</link>
		<comments>http://www.seifi.org/javascript/monkeying_around_with_the_fox.html#comments</comments>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<dc:creator>Joe Seifi</dc:creator>
				<category><![CDATA[firefox]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I've bee having fun using <a href="http://greasemonkey.mozdev.org/">Grease Monkey</a> to mess around with DHTML of websites in <a href="http://www.mozilla.org/products/firefox/">Firefox</a>. My first shot was a very simple <a href="/blog/files/yahoo.user.js">Yahoo Cleanser</a> user script that removes the ads on the main yahoo page. The possibilites are endless given the use <a href="http://xulplanet.com/references/objref/XMLHttpRequest.html">XMLHTTPRequest </a>, <a href="http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html">TreeWalkers</a> and an array of other mozilla specific features. There are already hundreds of user scripts <a href="http://dunck.us/collab/GreaseMonkeyUserScripts">available</a> for download.

To Install navigate to the <a href="/files/yahoo.user.js">script</a> and choose Install User Script from the Tools menu, and Click OK. Next time you visit yahoo.com it should be nicely cleansed of ads.
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve bee having fun using <a href="http://greasemonkey.mozdev.org/">Grease Monkey</a> to mess around with DHTML of websites in <a href="http://www.mozilla.org/products/firefox/">Firefox</a>. My first shot was a very simple <a href="http://seifi.org/wp-content/uploads/2005/04/yahoo.user.js">Yahoo Cleanser</a> user script that removes the ads on the main yahoo page. The possibilites are endless given the use <a href="http://xulplanet.com/references/objref/XMLHttpRequest.html">XMLHTTPRequest </a>, <a href="http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html">TreeWalkers</a> and an array of other mozilla specific features. There are already hundreds of user scripts <a href="http://dunck.us/collab/GreaseMonkeyUserScripts">available</a> for download.</p>
<p>To Install navigate to the <a href="http://seifi.org/wp-content/uploads/2005/04/yahoo.user.js">script</a> and choose Install User Script from the Tools menu, and Click OK. Next time you visit yahoo.com it should be nicely cleansed of ads.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seifi.org/javascript/monkeying_around_with_the_fox.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.905 seconds -->
