<?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>~robcee/ &#187; Code</title>
	<atom:link href="http://antennasoft.net/robcee/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://antennasoft.net/robcee</link>
	<description>more than just sandwiches</description>
	<lastBuildDate>Wed, 04 Jan 2012 15:59:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Scratchpad to get Current Visible Tabs</title>
		<link>http://antennasoft.net/robcee/2011/07/19/scratchpad-to-get-current-visible-tabs/</link>
		<comments>http://antennasoft.net/robcee/2011/07/19/scratchpad-to-get-current-visible-tabs/#comments</comments>
		<pubDate>Tue, 19 Jul 2011 12:32:01 +0000</pubDate>
		<dc:creator>robcee</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[devtools]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[scratchpad]]></category>

		<guid isPermaLink="false">http://antennasoft.net/robcee/?p=604</guid>
		<description><![CDATA[If you use Panorama (aka, TabView) in Firefox (6 and up) and want to get a list of the currently visible tabs (i.e., the tabs in your currently-selected group), here&#8217;s the code to run in a Scratchpad (set to Environment:Browser*): let group = gBrowser.visibleTabs; // current group group.map(function (c) c.linkedBrowser.currentURI.spec).join("\n"); Just select these two lines, [...]]]></description>
			<content:encoded><![CDATA[<p>If you use Panorama (aka, TabView) in Firefox (6 and up) and want to get a list of the currently visible tabs (i.e., the tabs in your currently-selected group), here&#8217;s the code to run in a Scratchpad (set to Environment:Browser*):</p>
<p><code style="font-size: small;">let group = gBrowser.visibleTabs; // current group<br />
group.map(function (c) c.linkedBrowser.currentURI.spec).join("\n");</code></p>
<p>Just select these two lines, right click and select &#8220;Display&#8221; and it&#8217;ll dump the currently visible URLs right into the Scratchpad. Nice.</p>
<p>Useful for adding links to a wiki or wherever else you might like to add links.</p>
<p>* &#8211; if you want to run code against the <strong>Browser Environment</strong> in Firefox, you&#8217;ll need to set <tt>devtools.chrome.enabled</tt> to <tt>true</tt> in <tt>about:config</tt>.</p>
<p>ps, thanks to @ttaubert for the code snippet!</p>
]]></content:encoded>
			<wfw:commentRss>http://antennasoft.net/robcee/2011/07/19/scratchpad-to-get-current-visible-tabs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Workspace [fixed-in-devtools][l10n?]</title>
		<link>http://antennasoft.net/robcee/2011/04/21/workspace-fixed-in-devtoolsl10n/</link>
		<comments>http://antennasoft.net/robcee/2011/04/21/workspace-fixed-in-devtoolsl10n/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 16:59:18 +0000</pubDate>
		<dc:creator>robcee</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[devtools]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[bikeshed]]></category>
		<category><![CDATA[l10n]]></category>
		<category><![CDATA[workspace]]></category>

		<guid isPermaLink="false">http://antennasoft.net/robcee/?p=587</guid>
		<description><![CDATA[Good news, everyone! This morning we landed the Workspace feature in our devtools project repository. This is exciting stuff for practitioners of JavaScript and we&#8217;ll have more to write about it very soon. hint, it&#8217;s probably a lot simpler and more powerful than you think it is. Many thanks to Mihai Sucan for taking the [...]]]></description>
			<content:encoded><![CDATA[<p><a title="tbpl by robceemoz, on Flickr" href="http://www.flickr.com/photos/robceemoz/5393221582/"><img class="aligncenter" src="http://farm6.static.flickr.com/5132/5393221582_9f5f095850.jpg" alt="tbpl" width="500" height="332" /></a></p>
<p>Good news, everyone! This morning we landed the <a href="https://wiki.mozilla.org/DevTools/Features/Workspaces">Workspace feature</a> in our devtools project repository. This is exciting stuff for practitioners of JavaScript and we&#8217;ll have more to write about it very soon. hint, it&#8217;s probably a lot simpler and more powerful than you think it is. Many thanks to Mihai Sucan for taking the <a title="Workspace" href="http://antennasoft.net/robcee/workspace/">add-on</a> and making it a feature. Also, special thanks to  Erik Vold for his contributions to the add-on. You&#8217;re in the Firefox source code now!</p>
<p>All is not unicorns and puppies though: there has been some concern expressed over the <em>name</em> of this feature. On the one hand, it might not easily convey what this thing <strong>does</strong>. A lot of things come to mind when I hear the term &#8220;workspace&#8221; used in a compu-technological context. Were it not for my years as a <a title="The Best Development Tools 1983 Had To Offer" href="http://antennasoft.net/robcee/2011/01/06/the-best-development-tools-1983-had-to-offer/">Smalltalker</a>, I&#8217;d think &#8220;window manager&#8221; and it is most-definitely not that.</p>
<p>The other, more important issue is, how will this localize? Axel, aka Pike, aka :l10n expressed some concern over the word. To get some feedback, I&#8217;ve written a <a href="http://groups.google.com/group/mozilla.dev.l10n/browse_thread/thread/798654e2e68b3ab4#">post in mozilla.dev.l10n</a> asking for help making Workspace internationalizable. Take a read, and drop a note in there if you have any suggestions.</p>
]]></content:encoded>
			<wfw:commentRss>http://antennasoft.net/robcee/2011/04/21/workspace-fixed-in-devtoolsl10n/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Workspace 0.5.3 + Bookmarks Deiconizer Approved</title>
		<link>http://antennasoft.net/robcee/2011/02/17/workspace-0-5-3-bookmarks-deiconizer-approved/</link>
		<comments>http://antennasoft.net/robcee/2011/02/17/workspace-0-5-3-bookmarks-deiconizer-approved/#comments</comments>
		<pubDate>Thu, 17 Feb 2011 18:18:51 +0000</pubDate>
		<dc:creator>robcee</dc:creator>
				<category><![CDATA[Addons]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[addons]]></category>
		<category><![CDATA[extensions]]></category>
		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://antennasoft.net/robcee/?p=580</guid>
		<description><![CDATA[Workspace 0.5.3 is released on AMO! One gotcha: If you&#8217;re running Firefox Beta 11 or under, you might want to wait for Beta 12 to come out before upgrading (which should be tagged for building today or tomorrow). If you&#8217;re on a nightly, you&#8217;ll want to upgrade right away. The reason for the fix is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://antennasoft.net/robcee/workspace/">Workspace 0.5.3</a> is released on <a href="https://addons.mozilla.org/en-US/firefox/addon/workspace/">AMO</a>!</p>
<p>One gotcha: If you&#8217;re running Firefox Beta 11 or under, you might want to wait for Beta 12 to come out before upgrading (which should be tagged for building today or tomorrow). If you&#8217;re on a nightly, you&#8217;ll want to upgrade right away.</p>
<p>The <a href="https://github.com/robcee/workspace/issues/closed#issue/21">reason</a> for the fix is a change to the <a href="http://mxr.mozilla.org/mozilla-central/source/toolkit/components/console/hudservice/PropertyPanel.jsm">PropertyPanel</a> which landed this week in mozilla-central made it impossible to close an object inspector panel opened from a Workspace.</p>
<p>Also, a newer version of the <a href="http://antennasoft.net/robcee/bookmarks-deiconizer/">Bookmarks Deiconizer</a> Add-on has been <a href="https://addons.mozilla.org/en-US/firefox/addon/bookmarks-deiconizer/">approved and released</a> that fixes the problem of icons being &#8220;re-iconized&#8221; when opening the bookmarks editor panel (star panel). It also now restores your bookmark toolbar&#8217;s icons on uninstall.</p>
]]></content:encoded>
			<wfw:commentRss>http://antennasoft.net/robcee/2011/02/17/workspace-0-5-3-bookmarks-deiconizer-approved/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Workspace 0.4.4</title>
		<link>http://antennasoft.net/robcee/2011/01/23/workspace-0-4-4/</link>
		<comments>http://antennasoft.net/robcee/2011/01/23/workspace-0-4-4/#comments</comments>
		<pubDate>Sun, 23 Jan 2011 23:14:15 +0000</pubDate>
		<dc:creator>robcee</dc:creator>
				<category><![CDATA[Addons]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[devtools]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[addons]]></category>
		<category><![CDATA[extensions]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[workspace]]></category>

		<guid isPermaLink="false">http://antennasoft.net/robcee/?p=573</guid>
		<description><![CDATA[Just a quick note to let people know that I&#8217;ve updated the Workspace extension recently. Added support for saving and loading files as well as a hotkey (F4) to open it from the browser. Many thanks to Erik Vold for some nice fixes and improvements! Install it here: http://antennasoft.net/addons/workspace.xpi.]]></description>
			<content:encoded><![CDATA[<p>Just a quick note to let people know that I&#8217;ve updated the <a href="http://antennasoft.net/robcee/workspace">Workspace</a> extension recently. Added support for saving and loading files as well as a hotkey (F4) to open it from the browser.</p>
<p>Many thanks to Erik Vold for some nice fixes and improvements!</p>
<p>Install it here: <a href="http://antennasoft.net/addons/workspace.xpi">http://antennasoft.net/addons/workspace.xpi</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://antennasoft.net/robcee/2011/01/23/workspace-0-4-4/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Oh no, Pinchy!</title>
		<link>http://antennasoft.net/robcee/2011/01/12/oh-no-pinchy/</link>
		<comments>http://antennasoft.net/robcee/2011/01/12/oh-no-pinchy/#comments</comments>
		<pubDate>Wed, 12 Jan 2011 14:58:24 +0000</pubDate>
		<dc:creator>robcee</dc:creator>
				<category><![CDATA[Addons]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Mozilla]]></category>

		<guid isPermaLink="false">http://antennasoft.net/robcee/?p=569</guid>
		<description><![CDATA[Sometime early this week, we disabled the pinch-zoom controls on trackpads in OS X (and maybe elsewhere, I&#8217;m unclear on how well-supported these gestures are on other platforms, but certainly present on mobile). You can read the gory details over in bug 613909. I use pinch-zoom All the Time. It&#8217;s a feature I can&#8217;t live [...]]]></description>
			<content:encoded><![CDATA[<p>Sometime early this week, we disabled the pinch-zoom controls on trackpads in OS X (and maybe elsewhere, I&#8217;m unclear on how well-supported these gestures are on other platforms, but certainly present on mobile). You can read the gory details over in <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=613909">bug 613909</a>.</p>
<p><img alt="Homer crying, &quot;Pinchy! Nooo!&quot;" src="http://www.cryingwhileeating.com/Homer.jpg" class="aligncenter" width="288" height="192" /></p>
<p>I use pinch-zoom All the Time. It&#8217;s a feature I can&#8217;t live without. Especially as I&#8217;ve gotten more used to doing similar actions on multitouch tablets and smart phones, the gesture feels natural to me. When in full screen mode, it makes sense to be able to resize the page to fit the ridiculous dimensions of my monitor.</p>
<p>Enter <a href="http://antennasoft.net/robcee/pinchy/">Pinchy</a>!</p>
<p>It&#8217;s a pretty simple add-on (built on the add-on sdk) that turns on some of the disabled preferences. Once you&#8217;ve installed it and it&#8217;s run, you can safely remove it or disable it from the Add-ons Manager.</p>
<p>You can accomplish the same thing either through about:config or by editing your prefs.js file in your profile directory. The prefs I&#8217;ve included are:</p>
<pre>user_pref("browser.gesture.pinch.in", "cmd_fullZoomReduce"); // zoom -
user_pref("browser.gesture.pinch.in.shift", "cmd_close"); // close tab
user_pref("browser.gesture.pinch.out", "cmd_fullZoomEnlarge"); // zoom +
user_pref("browser.gesture.pinch.out.shift", "View:FullScreen"); // toggle full screen
user_pref("browser.gesture.pinch.threshold", 66);
user_pref("browser.gesture.swipe.left.shift", "Browser:PrevTab"); // prev tab
user_pref("browser.gesture.swipe.right.shift", "Browser:NextTab"); // next tab
</pre>
<p>the Shift+Pinch in to close tab is particularly sweet. Also liking Shift+swipe to switch tabs. I have my prefs already set to go to the top of page and bottom of page on swipe and if there&#8217;s any demand, I can add those prefs in as well.</p>
<p>If only it were this easy to customize these gestures in every app.</p>
<p>Kudos to <a href="http://t.tal.by/post/95428783/changing-firefox-gestures">http://t.tal.by/post/95428783/changing-firefox-gestures</a> for the handy list of preferences (circa Firefox 3.1!).</p>
]]></content:encoded>
			<wfw:commentRss>http://antennasoft.net/robcee/2011/01/12/oh-no-pinchy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Workspace 0.3</title>
		<link>http://antennasoft.net/robcee/2011/01/10/workspace-0-3/</link>
		<comments>http://antennasoft.net/robcee/2011/01/10/workspace-0-3/#comments</comments>
		<pubDate>Mon, 10 Jan 2011 14:09:27 +0000</pubDate>
		<dc:creator>robcee</dc:creator>
				<category><![CDATA[Addons]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[devtools]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[addons]]></category>
		<category><![CDATA[workspace]]></category>

		<guid isPermaLink="false">http://antennasoft.net/robcee/?p=558</guid>
		<description><![CDATA[This weekend, I did a bit more work on the Workspace to get it closer to a releasable state. I also had some help in the form of some community contribution via the prolific Erik Vold on github. Download: workspace.xpi * added the relevant .htaccess bits so you can install directly from the link. Just [...]]]></description>
			<content:encoded><![CDATA[<p>This weekend, I did a bit more work on the <a href="http://antennasoft.net/robcee/workspace/">Workspace</a> to get it closer to a releasable state. I also had some help in the form of some community contribution via the prolific <a href="https://github.com/erikvold">Erik Vold</a> on <a href="https://github.com/robcee/workspace">github</a>.</p>
<p><strong>Download:</strong> <a href="http://antennasoft.net/addons/workspace.xpi">workspace.xpi</a></p>
<p><em>* added the relevant .htaccess bits so you can install directly from the link. Just click Allow. It&#8217;ll be ok, I promise!</em></p>
<p><strong>New Features</strong></p>
<ul>
<li> Added an entry to the Firefox Menu&#8217;s Web Developer submenu.</li>
<li> Added shortcut keys to Execute, Inspect and Print (ctrl/cmd-E, I and R respectively)</li>
<li> Stubbed in the Menu bar and additional context menu items</li>
<li> Chrome and Content contexts (via the menu bar)</li>
<li> Execute contents of Workspace Window if no selection</li>
<li> Code cleanup and some reorganization</li>
</ul>
<p><strong>Todo:</strong></p>
<ul>
<li> File Open and Save</li>
<li> The &#8220;ruler&#8221; on the statusbar</li>
<li> Persistence across restarts</li>
</ul>
<p>I think once we have those we can put it on AMO. Feedback and feature requests welcomed! Code moreso.</p>
]]></content:encoded>
			<wfw:commentRss>http://antennasoft.net/robcee/2011/01/10/workspace-0-3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>JavaScript Workspaces</title>
		<link>http://antennasoft.net/robcee/2011/01/05/javascript-workspaces/</link>
		<comments>http://antennasoft.net/robcee/2011/01/05/javascript-workspaces/#comments</comments>
		<pubDate>Wed, 05 Jan 2011 18:19:01 +0000</pubDate>
		<dc:creator>robcee</dc:creator>
				<category><![CDATA[Addons]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[devtools]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[addons]]></category>

		<guid isPermaLink="false">http://antennasoft.net/robcee/?p=539</guid>
		<description><![CDATA[One feature I wanted in Firefox 4 was a JavaScript Workspace. I know I&#8217;ve talked about it to a bunch of people. Most of the time, people looked at me like I had a chicken on my head. The concept is so simple yet hard to really convey how useful it is. Conversations inevitably go [...]]]></description>
			<content:encoded><![CDATA[<p>One feature I wanted in Firefox 4 was a JavaScript <a href="http://antennasoft.net/robcee/workspace/">Workspace</a>. I know I&#8217;ve talked about it to a bunch of people. Most of the time, people looked at me like I had a chicken on my head. The concept is so simple yet hard to really convey how useful it is.</p>
<p>Conversations inevitably go something like, &#8220;The Console already has a command line, isn&#8217;t that good enough?&#8221;</p>
<p>&#8220;Well, it&#8217;s great, but a Workspace lets you write out code as you think of it and it just stays there. You don&#8217;t have to go digging through history in case you want to copy and paste it elsewhere.&#8221;</p>
<p><em>more staring as if I had a chicken on my head followed by an incomprehensible, hand-wavey discussion about what you could do with them in Smalltalk…<br />
</em></p>
<p>Anyway, I decided to create a little add-on to better illustrate the idea. It&#8217;s pretty rough right now. It has a status bar that doesn&#8217;t do anything, and it doesn&#8217;t have nice menus to let you save and load files into it. But it has all the keyboard shortcuts you&#8217;d expect in an editor (cut/copy/paste) and a context menu that lets you Execute, Inspect or Print selected code against the currently active browser tab&#8217;s content. You can open one from the Tools menu (I know, I know, I need to add an entry to the developer menu in the Firefox menu. It&#8217;s a prototype!)</p>
<p>Try it out, let me know what you think.</p>
<p><strong>Download: </strong><a href="http://antennasoft.net/addons/workspace.xpi">http://antennasoft.net/addons/workspace.xpi</a></p>
<p><strong>Source:</strong> <a href="https://github.com/robcee/workspace">https://github.com/robcee/workspace</a></p>
<p><img class="aligncenter" src="http://www.japanator.com/elephant/ul/9274-Munchkin%20chicken.JPG" alt="" width="550" height="468" /></p>
]]></content:encoded>
			<wfw:commentRss>http://antennasoft.net/robcee/2011/01/05/javascript-workspaces/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Mozilla AllHands 2010 + Wikifytabs update</title>
		<link>http://antennasoft.net/robcee/2010/12/17/mozilla-allhands-2010/</link>
		<comments>http://antennasoft.net/robcee/2010/12/17/mozilla-allhands-2010/#comments</comments>
		<pubDate>Fri, 17 Dec 2010 18:06:10 +0000</pubDate>
		<dc:creator>robcee</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[devtools]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[extensions]]></category>

		<guid isPermaLink="false">http://antennasoft.net/robcee/?p=533</guid>
		<description><![CDATA[Every year we bring in Mozillians from around the globe to have a focused get-together. It&#8217;s a time when we can do some heavy planning, and brainstorm in one place. Often, some of the hallway conversations and parties generate good ideas. One conversation I had last night with Dietrich, Dolske and Mak was, how do [...]]]></description>
			<content:encoded><![CDATA[<p>Every year we bring in Mozillians from around the globe to have a focused get-together. It&#8217;s a time when we can do some heavy planning, and brainstorm in one place. Often, some of the hallway conversations and parties generate good ideas.</p>
<p>One conversation I had last night with Dietrich, Dolske and Mak was, how do we get new contributors up to speed on how to hack Firefox? We&#8217;ve already got a ton of excellent documentation on <a href="https://developer.mozilla.org/en-US/">MDN</a> for first-timers and seasoned veterans, but what most people really need is <a href="http://mxr.mozilla.org/mozilla-central">MXR</a> and <a href="http://hg.mozilla.org/mozilla-central">HG</a>.</p>
<p><strong>Setup some keyword searches:</strong></p>
<ol>
<li>Go to <a href="http://mxr.mozilla.org/mozilla-central/">http://mxr.mozilla.org/mozilla-central/</a>.</li>
<li>Right click on the Search For: field and select &#8220;Add a keyword for this search&#8221;.</li>
<li>Name it &#8220;mxr search&#8221; and give it the keyword &#8220;mxr&#8221;.</li>
<li>Repeat the process for the File Path field, and give it the keyword &#8220;mx&#8221;</li>
</ol>
<p>Now when you want to look up a reference or definition, type &#8220;mxr {search-term}&#8221; and it&#8217;ll return your search results. If you want to search for a file, say, browser.js, type &#8220;<a href="http://mxr.mozilla.org/mozilla-central/find?text=&amp;kind=text&amp;string=browser.js">mx browser.js</a>&#8221; and you&#8217;ll see the results. (Hint, the one you want is at the bottom of the page)</p>
<p>Got any other suggestions or hacks? Add &#8216;em in the comments!</p>
<p><strong>An Extension</strong></p>
<p>A couple of years ago, I wrote an extension to take a list of tabs in a window and generate a page with some easily copyable links in it. I neglected the extension and let it moulder until a triage meeting the other day and wanted to get a hunk of bug links out of my browser.</p>
<p>Well moulder no more!</p>
<p>I bring you a reinvigorated <a href="http://antennasoft.net/robcee/wikifytabs">WikifyTabs</a> with support for Wiki links, BBCode and HTML. <a href="https://addons.mozilla.org/en-US/firefox/addon/265035/">Check it out</a>, <a href="http://github.com/robcee/wikifytabs">browse the source</a>, make some improvements!</p>
]]></content:encoded>
			<wfw:commentRss>http://antennasoft.net/robcee/2010/12/17/mozilla-allhands-2010/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>console.foo() and you</title>
		<link>http://antennasoft.net/robcee/2010/11/29/console-foo-and-you/</link>
		<comments>http://antennasoft.net/robcee/2010/11/29/console-foo-and-you/#comments</comments>
		<pubDate>Mon, 29 Nov 2010 15:03:52 +0000</pubDate>
		<dc:creator>robcee</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[devtools]]></category>
		<category><![CDATA[Firebug]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[console]]></category>

		<guid isPermaLink="false">http://antennasoft.net/robcee/?p=519</guid>
		<description><![CDATA[For years, the world has been able to rely on Firebug and its console for debugging web sites. It has been a convenient and productive tool and we&#8217;d probably still be languishing in the window.dump() mines without it. A side-effect of this availability has made some patterns appear that don&#8217;t play nicely with consoles that [...]]]></description>
			<content:encoded><![CDATA[<p>For years, the world has been able to rely on Firebug and its console for debugging web sites. It has been a convenient and productive tool and we&#8217;d probably still be languishing in the window.dump() mines without it. A side-effect of this availability has made some patterns appear that don&#8217;t play nicely with consoles that aren&#8217;t implemented exactly the same way as Firebug&#8217;s console object. We&#8217;re running into a few of them <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=614350">now that Firefox has gained its own console object</a>.</p>
<p>Here&#8217;s a not-terribly hypothetical situation you might imagine. You&#8217;re a web-developer working for a small company. You&#8217;ve got a website. You want to do some debugging on your front-end scripts. Naturally, since you have Firebug installed, the first thing you do is drop a few of these around your code:</p>
<pre>console.log("I am here!");</pre>
<p>Simple, effective, printf-style debugging. Then you decide you want to show your manager what you&#8217;ve done on her own computer. You point her to the address and she loads it up and says, &#8220;this is broken. I don&#8217;t have Firebug installed so I&#8217;m getting exceptions calling console.log().&#8221;</p>
<p>Pwnd! You throw in a check that might look like this:</p>
<pre>if (window.console) {
  // set a variable, do some stuff, maybe write
  // your own log() wrapper...</pre>
<p>Problem solved!</p>
<p>Maybe then, you start getting fancy and add a timer to your new logging function.</p>
<pre>function myLogFunction(method, message) {
    console.time(method.toString());
    var result = method();
    console.timeEnd(method.toString());
    console.log(message, result);
}</pre>
<p>Neat-O! Except, console.time() isn&#8217;t a function in some browsers and now won&#8217;t work properly.</p>
<p>One possibility is to check explicitly for Firebug by expanding your first window.console check like this:</p>
<pre>if (window.console &amp;&amp; window.console.firebug) {</pre>
<p>That&#8217;s become a fairly standard pattern, though I believe it&#8217;ll exclude Chrome, Safari and Opera from your debugging efforts.</p>
<p>A better way is to test for each function you want to use:</p>
<pre>if ("console" in window &amp;&amp; "time" in window.console)
    // define your method</pre>
<p>This has the benefit of not coding for one particular type of debugging tool, will allow for graceful fallback in the event that your feature is not defined and allow you to tailor your debugging around different feature sets. This is the way libraries like jQuery check for browser capabilities and you should too. You want your website to work everywhere, don&#8217;t you?</p>
<p>An even better way around this would be to not ship your debugging code in a production web-site, but you may have good reasons to ignore this advice.</p>
]]></content:encoded>
			<wfw:commentRss>http://antennasoft.net/robcee/2010/11/29/console-foo-and-you/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Bookmarks Deiconizer, a Firefox Addon</title>
		<link>http://antennasoft.net/robcee/2010/11/26/bookmarks-deiconizer-a-firefox-addon/</link>
		<comments>http://antennasoft.net/robcee/2010/11/26/bookmarks-deiconizer-a-firefox-addon/#comments</comments>
		<pubDate>Fri, 26 Nov 2010 22:13:35 +0000</pubDate>
		<dc:creator>robcee</dc:creator>
				<category><![CDATA[Addons]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[addons]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[jetpack]]></category>

		<guid isPermaLink="false">http://antennasoft.net/robcee/?p=504</guid>
		<description><![CDATA[It&#8217;s Black Friday! For some of you, that means lots of shopping, post-turkey discomfort and watching football. Maybe all at once. For me, it meant checking out the latest development trunk of the Add-ons SDK (née Jetpack) and bundling up an add-on. There were a couple of fun things about doing this. One, all of [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s Black Friday! For some of you, that means lots of shopping, post-turkey discomfort and watching football. Maybe all at once. For me, it meant checking out the latest development trunk of the Add-ons SDK (née Jetpack) and bundling up an add-on.</p>
<p>There were a couple of fun things about doing this. One, all of the UI inspection was done with the built-in Inspector in Firefox. If you load up <span style="text-decoration: underline;">chrome://browser/content/browser.xul</span> in a tab and invoke the inspector (after setting <strong>devtools.inspector.enabled</strong> to <strong>true</strong> in <span style="text-decoration: underline;">about:config</span> and restarting), you can look at the various parts of the browser chrome.</p>
<p>To make the toolbar visible, you&#8217;ll probably have to select &#8220;View Bookmarks&#8221; from the bookmarks toolbar dropdown next to the search box in the UI. Even if it&#8217;s on, you&#8217;ll probably have to toggle it off and on again to get the bookmarks to show up.</p>
<div id="attachment_507" class="wp-caption aligncenter" style="width: 359px"><img class="size-full wp-image-507" title="bookmarks toolbar button" src="http://antennasoft.net/robcee/wp-content/uploads/2010/11/Screen-shot-2010-11-26-at-17.44.55.png" alt="bookmarks toolbar button" width="349" height="98" /><p class="wp-caption-text">Deselect the View Bookmarks Toolbar menu option and then re-enable it.</p></div>
<p>Once that&#8217;s done, open the Inspector (Cmd-Shift-I or from the Tools menu on a mac, Ctrl-Shift-I or the Web Developer submenu in the app menu on PC) and hover over the bookmarks toolbar in the browser.  Ultimately, you&#8217;ll want to highlight the toolbar element with id &#8220;PersonalToolbar&#8221; and take a look at its attributes. You&#8217;ll see that the <em>mode</em> attribute is set to &#8220;icons&#8221; by default.</p>
<p>Now for the magical part: Open the Web Console on this page (Cmd/Ctrl-shift-K). In the JS Input line, type:</p>
<p><span class="code">$(&#8220;PersonalToolbar&#8221;).setAttribute(&#8220;mode&#8221;, &#8220;text&#8221;);</span></p>
<p>and hit Enter. The icons should disappear from the embedded browser document.</p>
<p><img class="alignleft size-full wp-image-502" title="icon" src="http://antennasoft.net/robcee/wp-content/uploads/2010/11/icon.png" alt="" width="32" height="32" />And that&#8217;s pretty much all there is to this addon. Check out the <a href="https://github.com/robcee/bookmarks-deiconizer/blob/master/lib/main.js">source</a> on <a href="https://github.com/robcee/bookmarks-deiconizer/">github</a> or in <a href="http://hg.mozilla.org/users/rcampbell_mozilla.com/bookmarks-deiconizer/">hg</a>, view some minimal <a href="http://antennasoft.net/robcee/bookmarks-deiconizer/">documentation</a>, and, when it gets approved, install it from <a href="https://addons.mozilla.org/en-US/firefox/addon/258239/">AMO</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://antennasoft.net/robcee/2010/11/26/bookmarks-deiconizer-a-firefox-addon/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

