<?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>Mozilla Hacks - the Web developer blog</title>
	<atom:link href="http://hacks.mozilla.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://hacks.mozilla.org</link>
	<description>hacks.mozilla.org</description>
	<lastBuildDate>Wed, 08 Feb 2012 22:52:35 +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>Announcing the December Dev Derby Winners</title>
		<link>http://hacks.mozilla.org/2012/02/announcing-the-december-dev-derby-winners/</link>
		<comments>http://hacks.mozilla.org/2012/02/announcing-the-december-dev-derby-winners/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 22:09:12 +0000</pubDate>
		<dc:creator>John Karahalis</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Dev Derby]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[IndexedDB]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=11131</guid>
		<description><![CDATA[IndexedDB lets web applications store structured data for fast online and offline use. Data can be stored using key-value pairs, and values do not need to be serialized (as they do with document-oriented databases) or coerced into a relational structure (as with relational databases). Recently, creative developers from around the world demonstrated just how powerful [...]]]></description>
			<content:encoded><![CDATA[<p><a title="IndexedDB on MDN" href="https://developer.mozilla.org/en/IndexedDB">IndexedDB</a> lets web applications store structured data for fast online and offline use. Data can be stored using key-value pairs, and values do not need to be serialized (as they do with document-oriented databases) or coerced into a relational structure (as with relational databases).</p>
<p style="text-align: left"><img class="aligncenter size-full wp-image-8841" src="http://hacks.mozilla.org/wp-content/uploads/2011/07/logo-devderby.png" alt="" width="335" height="96" />Recently, creative developers from around the world demonstrated just how powerful IndexedDB can be in the <a href="https://developer.mozilla.org/en-US/demos/devderby/2011/december/">December Dev Derby</a>. Please join us in congratulating the top three demos as chosen by our judges.</p>
<p><img class="aligncenter size-full wp-image-11263" src="http://hacks.mozilla.org/wp-content/uploads/2012/02/december2011-dev-derby-winners1.png" alt="" width="500" height="204" /><strong>1st Place: </strong><a href="https://developer.mozilla.org/en-US/demos/detail/elibri">eLibri</a> by <a href="https://developer.mozilla.org/en-US/profiles/mar.castelluccio/">mar.castelluccio</a><br />
<strong>2nd Place: </strong><a href="https://developer.mozilla.org/en-US/demos/detail/filesystemdb">FileSystemDB </a>by <a href="https://developer.mozilla.org/en-US/profiles/mar.castelluccio/">mar.castelluccio</a><br />
<strong>3rd Place: </strong><a href="https://developer.mozilla.org/en-US/demos/detail/indexeddb-editor">IndexedDB Editor</a> by <a href="https://developer.mozilla.org/en-US/profiles/twolfson/">twolfson</a><strong><br />
</strong></p>
<p><strong>Runners up:</strong><br />
<a href="https://developer.mozilla.org/en-US/demos/detail/vurkout-buddy">Vurkout Buddy</a> by <a href="https://developer.mozilla.org/en-US/profiles/wcheung/">wcheung</a><br />
<a href="https://developer.mozilla.org/en-US/demos/detail/locate-it-indexeddb">Locate It IndexedDB</a> by <a href="https://developer.mozilla.org/en-US/profiles/nestoralvaro/">nestoralvaro</a></p>
<p>Congratulations to our winners and to everyone who submitted to the December Dev Derby.</p>
<p>Do you want to see your name here next month? We are now accepting demos related to <a href="https://developer.mozilla.org/en/DOM/Touch_events">Touch Events</a> (February), <a href="https://developer.mozilla.org/en/CSS/Using_CSS_transforms">CSS 3D Transforms</a> (March), and <a href="https://developer.mozilla.org/en/Using_HTML5_audio_and_video">HT<!--notag-->ML5 audio</a> (April). Get an early start by <a href="https://developer.mozilla.org/en-US/demos/devderby">submitting today</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2012/02/announcing-the-december-dev-derby-winners/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Wiki Wednesday: February 8, 2012</title>
		<link>http://hacks.mozilla.org/2012/02/wiki-wednesday-february-8-2012/</link>
		<comments>http://hacks.mozilla.org/2012/02/wiki-wednesday-february-8-2012/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 19:08:48 +0000</pubDate>
		<dc:creator>Eric Shepherd</dc:creator>
				<category><![CDATA[Docs]]></category>
		<category><![CDATA[Wiki Wednesday]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=11256</guid>
		<description><![CDATA[Here are today&#8217;s Wiki Wednesday articles! If you know about these topics, please try to find a few minutes to look over these articles that are marked as needing technical intervention and see if you can fix them up. You can do so either by logging into the wiki and editing the articles directly, or [...]]]></description>
			<content:encoded><![CDATA[<p>Here are today&#8217;s <a title="http://hacks.mozilla.org/2011/02/introducing-wiki-wednesdays/" href="http://hacks.mozilla.org/2011/02/introducing-wiki-wednesdays/" rel="external" target="_blank">Wiki Wednesday</a> articles! If you know about these topics, please try to find a few minutes to look over these articles that are marked as needing technical intervention and see if you can fix them up. You can do so either by logging into the wiki and editing the articles directly, or by emailing your notes, sample code, or feedback to <a title="mailto:mdnwiki@mozilla.org" href="mailto:mdnwiki@mozilla.org" rel="external" target="_blank">mdnwiki@mozilla.org</a>.</p>
<p>Contributors to Wiki Wednesday will get recognition in the next Wiki Wednesday announcement. Thanks in advance for your help!</p>
<p><strong>JavaScript</strong></p>
<ul>
<li><a href="https://developer.mozilla.org/en/JavaScript/Guide/Details_of_the_Object_Model" rel="custom">Details of the object model</a></li>
<li><a href="https://developer.mozilla.org/en/JavaScript/Reference/Operators/yield" rel="custom">yield</a></li>
<li><a href="https://developer.mozilla.org/en/JavaScript/Guide/Inheritance_and_the_prototype_chain" rel="custom">Inheritance and the prototype chain</a></li>
</ul>
<p><strong>SpiderMonkey</strong></p>
<ul>
<li><a href="https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JS_ExecuteRegExp" rel="custom">JS_ExecuteRegExp</a></li>
<li><a href="https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JS_GetOwnPropertyDescriptor" rel="custom">JS_GetOwnPropertyDescriptor</a></li>
<li><a href="https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JS_FlattenString" rel="custom">JS_FlattenString</a></li>
</ul>
<p><strong>Developing Mozilla</strong></p>
<ul>
<li><a href="https://developer.mozilla.org/en/Mozilla_Development_Strategies" rel="custom">Mozilla Development Strategies</a></li>
<li><a href="https://developer.mozilla.org/en/Layout_Debugger" rel="custom">Layout debugger</a></li>
<li><a href="https://developer.mozilla.org/en/Performance/Profiling_with_Xperf" rel="custom">Profiling with Xperf</a></li>
</ul>
<p><strong>Extensions</strong></p>
<ul>
<li><a href="https://developer.mozilla.org/en/Working_with_windows_in_chrome_code" rel="custom">Working with windows in chrome code</a></li>
<li><a href="https://developer.mozilla.org/en/Extensions/Bootstrapped_extensions" rel="custom">Bootstrapped extensions</a></li>
<li><a href="https://developer.mozilla.org/en/Creating_a_Mozilla_Extension/Adding_the_structure" rel="custom">Adding the structure</a></li>
</ul>
<p><strong>XUL</strong></p>
<ul>
<li><a href="https://developer.mozilla.org/en/CSS/Writing_Efficient_CSS" rel="custom">Writing efficient CSS for use in the Mozilla UI</a></li>
<li><a href="https://developer.mozilla.org/en/XULRunner/Creating_a_Windows_Inno_Setup_installer_for_XULRunner_applications" rel="custom">Creating a Windows Inno Setup installer for XULRunner applications</a></li>
<li><a href="https://developer.mozilla.org/en/Using_the_Editor_from_XUL" rel="custom">Using the Editor from XUL</a></li>
</ul>
<p><strong>XPCOM</strong></p>
<ul>
<li><a href="https://developer.mozilla.org/en/XPConnect/xpcshell" rel="custom">xpcshell</a></li>
<li><a href="https://developer.mozilla.org/en/Using_nsIDirectoryService" rel="custom">Using nsIDirectoryService</a></li>
<li><a href="https://developer.mozilla.org/en/Creating_XPCOM_Components/Setting_up_the_Gecko_SDK" rel="custom">Setting up the Gecko SDK</a></li>
</ul>
<p><strong>Interfaces</strong></p>
<ul>
<li><a href="https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIDOMFontFace" rel="custom">nsIDOMFontFace</a></li>
<li><a href="https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIWebSocketListener" rel="custom">nsIWebSocketListener</a></li>
<li><a href="https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIDragSession" rel="custom">nsIDragSession</a></li>
</ul>
<p><strong>Plugins</strong></p>
<ul>
<li><a href="https://developer.mozilla.org/en/Gecko_Plugin_API_Reference/Scripting_plugins" rel="custom">Scripting plugins</a></li>
<li><a href="https://developer.mozilla.org/en/NPN_GetURL" rel="custom">NPN_GetURL</a></li>
<li><a href="https://developer.mozilla.org/en/NPRegion" rel="custom">NPRegion</a></li>
</ul>
<p><strong>CSS</strong></p>
<ul>
<li><a href="https://developer.mozilla.org/en/CSS/transform" rel="custom">transform</a></li>
<li><a href="https://developer.mozilla.org/en/CSS/box-orient" rel="custom">box-orient</a></li>
<li><a href="https://developer.mozilla.org/en/CSS/word-spacing" rel="custom">word-spacing</a></li>
</ul>
<p><strong>SVG</strong></p>
<ul>
<li><a href="https://developer.mozilla.org/en/SVG/Attribute/x2" rel="custom">x2</a></li>
<li><a href="https://developer.mozilla.org/en/SVG/Attribute/lighting-color" rel="custom">lighting-color</a></li>
<li><a href="https://developer.mozilla.org/en/DOM/SVGFontElement" rel="custom">SVGFontElement</a></li>
</ul>
<p><strong>HTML</strong></p>
<ul>
<li><a href="https://developer.mozilla.org/en/HTML/Canvas/Drawing_DOM_objects_into_a_canvas" rel="custom">Drawing DOM objects into a canvas</a></li>
<li><a href="https://developer.mozilla.org/en/HTML/Element/frameset" rel="custom">frameset</a></li>
<li><a href="https://developer.mozilla.org/en/DOM/Input.setSelectionRange" rel="custom">Input.setSelectionRange</a></li>
</ul>
<p><strong>DOM</strong></p>
<ul>
<li><a href="https://developer.mozilla.org/en/Browser_Detection_and_Cross_Browser_Support" rel="custom">Browser Detection and Cross Browser Support</a></li>
<li><a href="https://developer.mozilla.org/en/Server-sent_events/Using_server-sent_events" rel="custom">Using server-sent events</a></li>
<li><a href="https://developer.mozilla.org/en/DOM/HTMLCollection" rel="custom">HTMLCollection</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2012/02/wiki-wednesday-february-8-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the Battery API &#8211; Part of WebAPI</title>
		<link>http://hacks.mozilla.org/2012/02/using-the-battery-api-part-of-webapi/</link>
		<comments>http://hacks.mozilla.org/2012/02/using-the-battery-api-part-of-webapi/#comments</comments>
		<pubDate>Tue, 07 Feb 2012 09:03:06 +0000</pubDate>
		<dc:creator>Robert Nyman</dc:creator>
				<category><![CDATA[WebAPI]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=11229</guid>
		<description><![CDATA[Detecting battery level in a device or computer can help you inform the user of the current status. Within Mozilla&#8217;s WebAPI, we have the Battery API to offer that possibility. Accessing the battery First, it&#8217;s a matter of accessing the battery object: var battery = navigator.mozBattery; Properties There are a few properties offered to detect [...]]]></description>
			<content:encoded><![CDATA[<p>Detecting battery level in a device or computer can help you inform the user of the current status. Within <a href="https://wiki.mozilla.org/WebAPI">Mozilla&#8217;s WebAPI</a>, we have the <a href="https://wiki.mozilla.org/WebAPI/BatteryAPI">Battery API</a> to offer that possibility.</p>
<p><span id="more-11229"></span></p>
<h2>Accessing the battery</h2>
<p>First, it&#8217;s a matter of accessing the battery object:</p>
<p><code>var battery = navigator.mozBattery;</code></p>
<h2>Properties</h2>
<p>There are a few properties offered to detect the charging level of the battery in the device: </p>
<dl>
<dt>Battery level</dt>
<dd>Check the currenty battery level. Returns a value between 0 and 1.</dd>
<dt>Battery charging</dt>
<dd>A boolean, returning if the device/computer is currently being charged.</dd>
<dt>Battery chargingTime</dt>
<dd>Time left in seconds until it is fully charged. Available when charging.</dd>
<dt>Battery dischargingTime</dt>
<dd>Time left in seconds until it is discharged. Available when not charging.</dd>
</dl>
<p><code>// Get battery level in percentage<br />
    var batteryLevel = battery.level * 100 + "%";</p>
<p>    // Get whether device is charging or not<br />
    var chargingStatus = battery.charging;</p>
<p>    // Time until the device is fully charged<br />
    var batteryCharged = battery.chargingTime;</p>
<p>    // Time until the device is discharged<br />
    var batteryDischarged = battery.dischargingTime;<br />
</code></p>
<h2>Events</h2>
<p>There are four events available for detecting changes to the battery&#8217;s status:</p>
<dl>
<dt>levelchange</dt>
<dd>If the battery level changes.</dd>
<dt>chargingchange</dt>
<dd>Detect if the device went from being charged to unplugged, or vice versa.</dd>
<dt>chargingtimechange</dt>
<dd>When the device&#8217;s charging time changes (when plugged in)</dd>
<dt>dischargingtimechange</dt>
<dd>When the device&#8217;s discharging time changed (when unplugged)</dd>
</dl>
<pre><code>battery.addEventLister("levelchange", function () {
    // Device's battery level changed
}, false);

battery.addEventListener("chargingchange", function () {
    // Device got plugged in to power, or unplugged
}, false);

battery.addEventListener("chargingtimechange", function () {
    // Device's charging time changed
}, false);

battery.addEventListener("dischargingtimechange", function () {
    // Device's discharging time changed
}, false);</code></pre>
<h2>Device support</h2>
<p>Battery API is supported in <a href="http://www.mozilla.org/firefox/beta/">Firefox Beta</a> on:</p>
<ul>
<li>Android (<a href="http://www.mozilla.org/firefox/aurora/">Firefox Aurora</a> only, for now)</li>
<li>Windows</li>
<li>Linux (for those distros that have <a href="http://upower.freedesktop.org/">UPower</a> installed &#8211; bundled with most nowadays)</li>
</ul>
<p>Right now we don&#8217;t have anyone working on the Mac OS X implemementation, so if you have the skills, <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=696045">we&#8217;d love to see you contribute</a>!</p>
<h2>Demo and code</h2>
<p>I&#8217;ve put together a basic <a href="http://robnyman.github.com/battery/">demo of the Battery API</a> and code is also available in the <a href="https://github.com/robnyman/robnyman.github.com/tree/master/battery">Battery API repository on GitHub</a>.</p>
<p>If you don&#8217;t experience the expected results on your device, please <a href="https://bugzilla.mozilla.org/enter_bug.cgi">file a bug</a> and we can look into it. This feature is experimental at this time, and may not be ready for production use just yet.</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2012/02/using-the-battery-api-part-of-webapi/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Tantek Çelik about the importance of Web Standards</title>
		<link>http://hacks.mozilla.org/2012/02/tantek-celik-about-the-importance-of-web-standards/</link>
		<comments>http://hacks.mozilla.org/2012/02/tantek-celik-about-the-importance-of-web-standards/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 16:23:32 +0000</pubDate>
		<dc:creator>Tristan Nitot</dc:creator>
				<category><![CDATA[Featured Article]]></category>
		<category><![CDATA[Mission:Mozilla]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=11207</guid>
		<description><![CDATA[This is the fourth installment of Mission:Mozilla, a series of interviews that link Mozillians, the technology they produce and the Mozilla mission. This time, We&#8217;re interviewing Tantek Çelik, a long-time Web standards contributor. He started working on web standards at Microsoft in 1998, while leading the development of Tasman, the IE Mac rendering engine, and [...]]]></description>
			<content:encoded><![CDATA[<p>This is the fourth installment of <a href="http://hacks.mozilla.org/category/missionmozilla/">Mission:Mozilla</a>, a series of interviews that link Mozillians, the technology they produce and the Mozilla mission. This time, We&#8217;re interviewing Tantek Çelik, a long-time Web standards contributor. He started working on web standards at Microsoft in 1998, while leading the development of Tasman, the IE Mac rendering engine, and subsequently founded independent efforts like microformats.org, BarCamp, and most recently, IndieWebCamp.org.</p>
<p><strong>Tristan</strong> &#8211; Hi Tantek, could you introduce yourself? (I could point our reader to <a href="http://en.wikipedia.org/wiki/Tantek">your Wikipedia page</a>, but it seems a bit out of date).</p>
<p><strong>Tantek</strong> &#8211; I&#8217;ve been passionate about web standards since being inspired at the level of collaboration among different companies, cultures, individuals at my first W3C CSS&amp;PF WG meeting May 1998 in Paris. My interest in standards as building blocks started much earlier with many childhood hours spent building things with LEGOs.</p>
<p><strong>Tristan</strong> &#8211; Ah, LEGOs! I have fond memories of them, particularly LEGO technic! They&#8217;ve inspired so many geeks that they somehow should be credited for their work in W3C specs, don&#8217;t you think? ;-)</p>
<p><strong>Tantek</strong> &#8211; Indeed I think LEGOs have inspired many an engineer. Simple pieces that could be combined in numerous ways and built into amazing unique and creative structures.</p>
<p><strong>Tristan</strong> &#8211; Sounds like a good description of Web technologies to me! Who was your employer back then?</p>
<p><strong>Tantek</strong> &#8211; I was working for Microsoft at the time, having joined the Macintosh Internet Products Group in 1997. I started work on Macintosh Internet Explorer (MacIE) in mid 1997 with mostly bug fixes and improvements in CSS support which incrementally made their way into MacIE 4. It was soon clear though that we needed a fairly big overhaul to implement better CSS support. Soon after I joined standards discussions in the W3C.</p>
<p><strong>Tristan</strong> &#8211; It&#8217;s a little known fact, but IE Mac was really raising the bar when it came to CSS compliance. It was a time where few people cared about Web standards. I was at Netscape back then, and you at Microsoft. It was amazing to see a team trying to push Web standards on the other side of the fence!</p>
<p><strong>Tantek</strong> &#8211; When I was made the developer lead for the MacIE rendering engine, it wasn&#8217;t immediately obvious to me what we should focus on, so I decided to interview web design firms in San Francisco and just ask: &#8220;Hi I&#8217;m with the Microsoft MacIE team. What would you like to see in terms of standards / rendering support in the next version of MacIE?&#8221; The answers were loud and clear: dependable standards support! In particular: reliable and ideally complete CSS support, &#8220;XML support&#8221; (whatever that meant), and better Javascript/DOM support. A few specifically asked for PNG support. Those interviews drove the priorities of what became <em>Tasman</em>, the new rendering engine for MacIE5 which itself in the process got renamed to Internet Explorer 5 for Macintosh (IE5/Mac). Little did I know at the time that such a focus on getting web standards right would come as a surprise to others.</p>
<p><strong>Tristan</strong> &#8211; And now, a few years down the road, we&#8217;ve seen how Web standards have made the Web what it is today, but they&#8217;re also something that Web browser vendors are heavily investing on! What do you do for Mozilla today? Why should Web developers care?</p>
<p><strong>Tantek</strong> &#8211; I joined Mozilla in May 2010 as Web Standards Lead and I&#8217;m excited to be working with so many people passionate about standards. In an organization with numerous talented web standards contributors, in addition to editing/iterating specifications, my role is often more of coordination and collaboration, making sure that folks who care about particular standards find each other and work together. One key thing I&#8217;ve created and driven in Mozilla is the open documentation of our standards participation, in a public place where not only we (Mozillians) can find each other, but web developers in general can see <a href="https://wiki.mozilla.org/Standards">how much effort Mozilla and individual Mozillians put into web standards</a>.</p>
<p><strong>Tristan</strong> &#8211; I have the impression that Mozilla does not get the share of credit we deserve when it comes to our work on standards. Don&#8217;t you agree?</p>
<p><strong>Tantek</strong> &#8211; As someone who&#8217;s been involved with web standards for over a decade, I&#8217;ve had a deep respect for Mozilla&#8217;s involvement with web standards for quite some time. However I do think that recognition can easily be forgotten outside of standards circles. I think the web community as a whole greatly underestimates the longevity, depth, and dedication of Mozilla&#8217;s contributions to web standards.</p>
<p><strong>Tristan</strong> &#8211; Where do you think Mozilla particularly shines?</p>
<p><strong>Tantek</strong> &#8211; One thing that&#8217;s always impressed me about Mozilla&#8217;s commitment to web standards is the level of quality and thoroughness that Mozilla places into implementations. In my experience, historically Firefox has had the highest fidelity handling of various CSS properties for example, focusing more on getting things precisely right rather than shipping quick implementations that may only cover common or 80% cases.</p>
<p>Second, Mozilla works far more in the open, early and often, than any other organization. For example, we do nearly all our project work on open wiki pages on <a href="https://wiki.mozilla.org">wiki.mozilla.org</a>. I even keep my own Mozilla projects list on an open Mozilla wiki page. It makes it really easy to answer when people ask me<a href="https://wiki.mozilla.org/Tantek-Mozilla-projects"> what am I working on these days</a>.</p>
<p><strong>Tristan</strong> &#8211; I agree with you. I sense that Mozilla tends to do the right thing, rather than the thing that makes us look good. Can you give an example why do Web standards matter?</p>
<p><strong>Tantek</strong> &#8211; <em>The browser compatibility tax</em>. When the Web Standards Project started in 1998, they raised the real and painful issue of the &#8220;browser compatibility tax&#8221; that developers had to pay when developing web sites. No matter what standard a web author would use, they&#8217;d have to spend potentially 50-75% of their time purely on making their code work in multiple browsers, sometimes having to write multiple versions of their markup and style sheets and then use fragile user-agent string tests to serve different content (a bad habit that still persists to this day). Much of this was due to the abysmal standards support in 1990s browsers.</p>
<p>Web standards are an agreement between authors and browsers: if the author writes valid code (whether HTML, CSS, or JS), the browsers agree to render and execute it predictably and according to the standards. Without standards, web authors end up wasting their time coding for one browser at a time (typically focusing on whatever is the popular browser that year), and browsers developers end up wasting their time writing code fixing one site at a time.</p>
<p><strong>Tristan</strong> &#8211; And if we want the Web to be the platform of choice for all kind of developers and all kinds of applications, from desktop to mobile, we need to remove this &#8220;browser compatibility tax&#8221;.</p>
<p><strong>Tantek</strong> &#8211; Yes. It&#8217;s up to all of us as browser implementers to provide strictly correct implementations of web standards for authors to use, and for implementers to openly propose and test innovations in web standards.</p>
<p><strong>Tristan</strong> &#8211; what&#8217;s your biggest concern about Web standards?</p>
<p><strong>Tantek</strong> &#8211; My biggest concern about web standards can be summed up in four words: <em>&#8220;Best Viewed In [...]&#8220;</em> where the fourth word can be filled in with a different browser nearly every year. Anything that encourages web authors to focus on a single browser (or browser engine) to the expense of other browsers hurts the web. It&#8217;s also short-sighted &#8211; next year all the browsers will change and what was &#8220;best&#8221; last year is not the same this year, even newer versions of the same browser!</p>
<p>Worst of all is when browser vendors themselves either encourage or outright publish &#8220;best viewed in&#8221; content themselves, thus setting a bad example for web authors.</p>
<p>Judge for yourself &#8211; whenever you see a site purporting to show-off or demonstrate web standards, if the site ever gives you an excuse like &#8220;Please use browser X to view this&#8221; then they&#8217;re misbehaving. Standards demonstrations should simply state the standards they require, and then link to test suites (developed in standards bodies) for you to check your own browser.</p>
<p>And &#8220;Best Viewed In&#8221; is just one of several concerns.</p>
<p>There are many difficult challenges to open web standards that we must acknowledge and continue fighting hard to overcome. Challenges like patents that may hurt Touch Events, devices that only effectively support a single browser engine, and when one or a small number of companies decide to dictate <em>de-facto</em> standards through &#8220;delayed open&#8221; tactics.</p>
<p><strong>Tristan</strong> &#8211; What&#8217;s the most exciting thing going on in the world of Web standards these days?</p>
<p><strong>Tantek</strong> &#8211; So many things to choose from! I think the most exciting thing about web standards these days is the unprecedented level of intense interest and collaboration across numerous companies on the open web platform built on web standards. There&#8217;s a rising culture of placing importance on the open web, and I think we have Mozilla to thank for keeping that flame alive for so long and setting an ever higher bar for how to best work openly on open web standards.</p>
<p>The Mozilla Manifesto provides an excellent set of principles for how to do so. I think what&#8217;s particularly important is to keep evolving openness, and Mozilla encourages community members to contribute their own views on how and why to work openly. Here is some more on the subject:</p>
<ul>
<li><a href="http://paulrouget.com/e/openness/">http://paulrouget.com/e/openness/</a></li>
<li><a href="http://tantek.com/2010/281/b1/what-is-the-open-web">http://tantek.com/2010/281/b1/what-is-the-open-web</a></li>
<li><a href="http://tantek.com/2011/168/b1/practices-good-open-web-standards-development">http://tantek.com/2011/168/b1/practices-good-open-web-standards-development</a></li>
</ul>
<p><strong>Tristan</strong> &#8211; Thank you very much for your time Tantek, and keep up the good (and open) work!</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2012/02/tantek-celik-about-the-importance-of-web-standards/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FOSDEM 2012: Mozilla Labs Apps and The Future of HTML5 Games</title>
		<link>http://hacks.mozilla.org/2012/02/fosdem-2012-mozilla-labs-apps-and-the-future-of-html5-games/</link>
		<comments>http://hacks.mozilla.org/2012/02/fosdem-2012-mozilla-labs-apps-and-the-future-of-html5-games/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 10:11:43 +0000</pubDate>
		<dc:creator>Rob Hawkes</dc:creator>
				<category><![CDATA[Apps]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Featured Article]]></category>
		<category><![CDATA[Gaming]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=11200</guid>
		<description><![CDATA[In this post I round-up my first time at FOSDEM and the two talks I gave during my time there; one on open Web apps and the other on creating games with HTML5. This past weekend I have been in Brussels at FOSDEM, and absolutely massive free event for the open source software community. I [...]]]></description>
			<content:encoded><![CDATA[<p><em>In this post I round-up my first time at FOSDEM and the two talks I gave during my time there; one on open Web apps and the other on creating games with HTML5.</em></p>
<p><span id="more-11200"></span></p>
<p>This past weekend I have been in Brussels at <a href="http://fosdem.org/2012/">FOSDEM</a>, and absolutely massive free event for the open source software community. I hear there were over 5,000 people there this weekend, that&#8217;s a lot of people.</p>
<p>Mozilla had a great presence there this year and hosted two full days of talks in the <a href="http://fosdem.org/2012/schedule/track/mozilla_devroom">Mozilla DevRoom</a>.</p>
<p><a href="http://www.flickr.com/photos/nitot/6818119445/" title="Developer engagement team @ Fosdem 2012 by nitot, on Flickr"><img src="http://farm8.staticflickr.com/7170/6818119445_ac4e676fc4_z.jpg" width="500" alt="Developer engagement team @ Fosdem 2012"></a></p>
<p>The Developer Engagement team also had a presence this weekend and put on a variety of talks ranging from <a href="http://fosdem.org/2012/schedule/event/getting_started_with_the_addon_sdk">hacking the Web with Jetpack</a>, to <a href="http://fosdem.org/2012/schedule/event/2012_new_perspectives_for_mozilla">Mozilla&#8217;s new perspectives for 2012</a>, to <a href="http://fosdem.org/2012/schedule/event/open_web_documentation_aimed_at_web_devs">creating open Web documentation</a>.</p>
<p>All in all, FOSDEM is a pretty awesome event absolutely crammed full of developers who care immensely about open software. It is very much a Linux-fest but the talks on Web technologies seemed to go down well. And aside from a few cases of anti-Apple/Microsoft/HTML5 sentiment the event was very successful and well-behaved.</p>
<h2>Open Web Apps and the Mozilla Labs Apps project</h2>
<p>The first talk that I had the opportunity to give at FOSDEM was on open Web apps and the <a href="https://developer.mozilla.org/en/Apps">Mozilla Labs Apps project</a>. It&#8217;s a very interesting topic that has been encouraging developers to think beyond the concept of Web apps being something that is just in the browser.</p>
<p><iframe src="http://www.slideshare.net/slideshow/embed_code/11417514" width="500" height="550" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<h2>Open Web Games with HTML5 &amp; JavaScript</h2>
<p>The second talk that I gave was on open Web game development with HTML5 &amp; JavaScript. During this talk I highlighted a selection of recent events within the HTML5 game industry as well as the key technologies that are involved. I also demoed the <a href="https://wiki.mozilla.org/GamepadAPI">Gamepad API</a> working in Firefox with a wireless xBox 360 controller.</p>
<p><iframe src="http://www.slideshare.net/slideshow/embed_code/11428870" width="500" height="550" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2012/02/fosdem-2012-mozilla-labs-apps-and-the-future-of-html5-games/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aurora 12 is out &#8211; improvements and updated Developer Tools</title>
		<link>http://hacks.mozilla.org/2012/02/aurora-12-is-out-improvements-and-updated-developer-tools/</link>
		<comments>http://hacks.mozilla.org/2012/02/aurora-12-is-out-improvements-and-updated-developer-tools/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 22:49:06 +0000</pubDate>
		<dc:creator>Robert Nyman</dc:creator>
				<category><![CDATA[Aurora]]></category>
		<category><![CDATA[Developer Tools]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=11176</guid>
		<description><![CDATA[Aurora 12 is out, together with updated Developer Tools, and these are the improvements/changes. Highlights A few of the improvements that stand out a little more: ECMAScript Harmony&#8217;s Simple Map and Set builtins For testing purposes, we have implemented ECMAScript Harmony&#8217;s Simple Map and Set builtins. This is only in Aurora and will be disabled [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.mozilla.org/firefox/channel/">Aurora 12</a> is out, together with updated Developer Tools, and these are the improvements/changes.</p>
<p><span id="more-11176"></span></p>
<h2>Highlights</h2>
<p>A few of the improvements that stand out a little more:</p>
<h3>ECMAScript Harmony&#8217;s Simple Map and Set builtins</h3>
<p>For testing purposes, we have implemented <a href="http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets">ECMAScript Harmony&#8217;s Simple Map and Set builtins</a>. This is only in Aurora and will be disabled when it goes to beta, so plase test it out now and give feedback! There is also <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Set">MDN documentation on Set</a> and <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Map">MDN documentation on Map</a> if you want to learn more.</p>
<p>If you are more interested in Harmony progress, <a href="https://wiki.mozilla.org/ES6_plans">read up on our implementation work for ECMAScript 6</a></p>
<h3>Support multitouch on Android</h3>
<p>We&#8217;re happy to now have implemented <a href="https://developer.mozilla.org/en/DOM/Touch_events">multitouch</a> for Firefox on Android!</p>
<h3>Let authors put line breaks (newlines) in tooltips (title attribute)</h3>
<p>It might seem like a small thing, but have been discussed quite some time. You can now <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=358452">use newlines for tooltips</a>!</p>
<h3>XMLHttpRequest should allow to specify a network timeout in ms (for async requests)</h3>
<p>Instead of timeouts and similar, this offers a way to <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=525816">speficy a network timeout for XMLHttpRequests</a> using <a href="http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#the-timeout-attribute">the timeout attribute</a>.</p>
<h2>List of improvements</h2>
<p>Here are all the improvements we&#8217;ve made complete with links to each bug listing for those who want to read up more on respective implementation.</p>
<h3>DOM</h3>
<ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=302566">When JavaScript is disabled, alternate content provided within the canvas element is not rendered and the canvas element still is rendered</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=603008">Support multitouch on Android</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=102699">Implement text/html for @mozilla.org/xmlextras/domparser</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=705640">Implement DOMError as defined in DOM 4</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=358452">Let authors put line breaks (newlines) in tooltips (title attribute)</a></li>
</ul>
<h3>JavaScript</h3>
<ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=697479">Implement Harmony simple Map and Set builtins</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=718128">Implement ArrayBuffer.slice</a></li>
<li><a href="https://developer.mozilla.org/en/JavaScript/Sharp_variables_in_JavaScript">Removed support for sharp variables</a></li>
</ul>
<h3>Layout</h3>
<ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=208309">There is no Bidi/Joining algorithm on Arabic/Persian texts in MathML</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=497995">Implement border-image revisions in latest css3-background</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=695222">Implement column-fill property of CSS3 spec</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=611099">remove handling of percentages as intrinsic widths/heights (SVG height=&#8221;100%&#8221; width=&#8221;100%&#8221; defaults)</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=591718">getBoundingClientRect needs to take transforms into account</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=711049">Adjust MathML text integration point treatment to comply with spec changes</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=711052">Remove a pop loop from &lt;rp&gt; and &lt;rt&gt; handling, because the loop has been removed from the spec long ago</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=557476">(munderover-align) [MathML3] munder, mover, munderover: add support for the align attribute</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=536557">Implement CSS3 text-align-last</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=711958">Add a &#8216;length&#8217; property to DOMSVGStringList</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=607854">SVGTests interface is not implemented</a></li>
</ul>
<h3>Media</h3>
<ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=682299">Implement crossOrigin attribute for &lt;video&gt; element (for webgl)</a></li>
</ul>
<h3>Network</h3>
<ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=712188">Return correct websocket close code when browser navigates away from page</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=702820">Allow XHR to data URL</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=525816">XMLHttpRequest should allow to specify a network timeout in ms (for async requests)</a></li>
</ul>
<h3>Tools</h3>
<ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=712134">Log messages to console explaining media load algorithm failure</a></li>
</ul>
<h2>Developer Tools</h2>
<p>There has been a total of 89 improvements to Web Console, Scratchpad, Style Editor, Page Inspector, Style Inspector, HTML view and Page Inspector 3D view (Tilt). Here are the highlights:</p>
<ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=611032">Errors and messages that were logged before the Web Console was opened are displayed when the console is opened up to a queue size limit</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=650345">Scratchpad now includes Find and uses the standard platform key binding (ctrl-F/cmd-F)</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=714942">Scratchpad now includes Jump to Line and uses the standard platform key binding ctrl/cmd-J</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=687698">Style Editor now includes transitions </a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=713612">Style Editor adds in a closing brace for new rules to avoid disrupting the rest of the CSS</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=715647">You can now remove nodes from the Page Inspector 3D view by pressing &#8216;x&#8217;. This makes it easier to visually select the node you want.</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=720431">Normal close window keybinding works for Style Editor</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=566092">Page Inspector highlighter now updates its position as the page changes</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2012/02/aurora-12-is-out-improvements-and-updated-developer-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SPDY Brings Responsive and Scalable Transport to Firefox 11</title>
		<link>http://hacks.mozilla.org/2012/02/spdy-brings-responsive-and-scalable-transport-to-firefox-11/</link>
		<comments>http://hacks.mozilla.org/2012/02/spdy-brings-responsive-and-scalable-transport-to-firefox-11/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 22:16:14 +0000</pubDate>
		<dc:creator>Patrick McManus</dc:creator>
				<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=10976</guid>
		<description><![CDATA[Firefox 11 contains the first Firefox implementation of the SPDY protocol. SPDY is a secure web transport protocol that encapsulates HTTP/1 while replacing its aging connection management strategies. This results in more responsive page loads today and enables better scalability with the real time web of tomorrow. The most important goal of SPDY is to [...]]]></description>
			<content:encoded><![CDATA[<p>Firefox 11 contains the first Firefox implementation of the SPDY protocol. SPDY is a secure web transport protocol that encapsulates HTTP/1 while replacing its aging connection management strategies. This results in more responsive page loads today and enables better scalability with the real time web of tomorrow.</p>
<p>The most important goal of SPDY is to transport web content using fewer TCP connections. It does this by multiplexing large numbers of transactions onto one TLS connection. This has much better latency properties than native HTTP/1. When using SPDY a web request practically never has to wait in the browser due to connection limits being exhausted (e.g. the limit of 6 parallel HTTP/1 connections to the same host name). The request is simply multiplexed onto an existing connection.</p>
<p>Many web pages are full of small icons and script references. The speed of those transfers is limited by network delay instead of bandwidth. SPDY ramps up the parallelism which in turn removes the serialized delays experienced by HTTP/1 and the end result is faster page load time. By using fewer connections, SPDY also saves the time and CPU needed to establish those connections.</p>
<p>The page-load waterfall diagram below tells the story well. Note the large number of object requests that all hit the network at the same time. All of their individual load times are comprised exclusively of network delay and by executing them in parallel the total page load time is reduced to a single round trip.</p>
<p><img src="http://hacks.mozilla.org/wp-content/uploads/2012/01/waterfall.png" alt="" title="Waterfall" width="400" height="293" class="aligncenter size-full wp-image-10986" /></p>
<p>Generally speaking, web pages on high latency connections with high numbers of embedded objects will see the biggest benefit from SPDY. That&#8217;s great because its where the web should be going. High latency mobile is a bigger part of the Internet every day, and as the Internet spreads to parts of the world where it isn&#8217;t yet common you can count on the fact that the growth will be mobile driven. Designs with large numbers of objects are also proving to be a very popular paradigm. Facebook, G+, Twitter and any avatar driven forum are clear examples of this. Rather than relying on optimization hacks such as sprites and data urls that are hard to develop and harder to maintain we can let the transport protocol do its job better.</p>
<p>Beyond better page load time, there is good reason to think this approach is good for the web&#8217;s foundation. The way HTTP/1 uses large numbers of small and parallel active connections creates a giant networking congestion problem. This inhibits the deployment of real time applications like WebRTC, VOIP, and some highly interactive games. SPDY&#8217;s small number of busier connections fit the congestion control model of the Internet much better and enables the transport of classic web content to cooperate better with these real time applications. Web browsers have only managed to keep the congestion problem in check with HTTP/1 through arbitrary limits on its parallelism. With SPDY we can have our parallel-cake and eat it in low latency conditions too. This property is what I find most promising about SPDY, and <a href="http://bitsup.blogspot.com/2011/12/spdy-bufferbloat-http-and-real-time.html"">I&#8217;ve written about it extensively in the past</a>.</p>
<p>There is a great transition path onto SPDY. It is a new protocol, but it uses the old https:// protocol scheme in URIs. No changes to markup are needed to use SPDY. Generally SPDY servers support both SPDYand HTTP/1 for use with browsers that are not SPDY capable. The protocol used is silently negotiated through a TLS extension called Next Protocol Negotiation. The great news here is that upgrading to SPDY is just a matter of an administrative server upgrade. No changes to content are needed and things like REST APIs continue to work unmodified. Indeed, a SPDY site is not visually different in any way from an HTTP/1 site.</p>
<p>Google did a lot of work to launch this technology and to evolve it in the open, but it isn&#8217;t a Google only project any more. Since the implementations in Chrome and various Google web services were introduced we have seen either code or commitments regarding SPDY from many other products and groups including Amazon&#8217;s tablet, node.js, an Apache module, curl, nginx, and even a couple CDNs along with Mozilla. In my opinion, that kind of reaction is because engineers have looked at this and decided that it is solves several serious problems with HTTP&#8217;s connection handling and that this is a technology well positioned for us all to cooperate on. There is also discussion and preliminary movement in all the right standardization forums such as the W3C TAG and the IETF. Open standardization of the protocol is a key condition of Mozilla&#8217;s interest in it, but it is not a precondition to using it. Gathering operational experience instead of just engineering on whiteboards, is a valuable part of how the best protocols are made. The details of SPDY can be iterated based on that experience and the standardization process. The protocol is well suited to that evolution at this stage.</p>
<p>SPDY needs to be explicitly enabled through about:config in Firefox 11. Go to that URL and search for network.http.spdy.enabled and set it to true. Future revisions hope to have it enabled by default.</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2012/02/spdy-brings-responsive-and-scalable-transport-to-firefox-11/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Mozilla Hacks Weekly, February 2nd 2012</title>
		<link>http://hacks.mozilla.org/2012/02/mozilla-hacks-weekly-february-2nd-2012/</link>
		<comments>http://hacks.mozilla.org/2012/02/mozilla-hacks-weekly-february-2nd-2012/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 14:20:28 +0000</pubDate>
		<dc:creator>Robert Nyman</dc:creator>
				<category><![CDATA[BrowserID]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Mozilla Hacks Weekly]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=11147</guid>
		<description><![CDATA[After a little break, Mozilla Hacks Weekly is now back! More reading tips from Mozilla&#8217;s Developer Engagement team. We also have a new format for our content, so please let us know if you have any thoughts on that! At the end of this blog post, you also have all the Developer Engagement team members [...]]]></description>
			<content:encoded><![CDATA[<p>After a little break, Mozilla Hacks Weekly is now back! More reading tips from <a href="https://wiki.mozilla.org/Engagement/Developer_Engagement">Mozilla&#8217;s Developer Engagement</a> team. We also have a new format for our content, so please let us know if you have any thoughts on that!</p>
<p><span id="more-11147"></span></p>
<p>At the end of this blog post, you also have all the Developer Engagement team members and what they work on, if you are interested in discussing more, contributing or taking part of our work.</p>
<h2>Weekly links</h2>
<p>If there is anything you think we should read or know about, don&#8217;t hesitate to post a comment, contact us on Twitter or through any other means.<br />
The picks this week are:</p>
<ul>
<li><a href="http://msujaws.wordpress.com/2012/02/01/layout-paint-flashing-in-firefox/">Layout paint flashing in Firefox</a> &#8211; Detect when a region of the web browser requires repainting.</li>
<li>James Long shows just how simple it is to <a href="http://jlongster.com/2011/12/28/rotating-webpages-with-a-gamepad.html">use a Wii controller and CSS transitions to change web sites</a> in Firefox.</li>
<li><a href="http://beingintelligently.com/?p=34">The Case for Browser ID</a> &#8211; A thoroughly clueful analysis supporting BrowserID as a pragmatic solution for identity on the Web, including key ingredients and current issues. </li>
<li>Slide decks are little by little moving from dedicated Powerpoint-like applications to the web. Among the numerous slide engines around, <a href="http://bartaz.github.com/impress.js/">impress.js</a> is really visually appealing, but, beware!, you need a browser supporting CSS3 Transforms, both 2D and 3D, and Transitions (For Firefox, it is from Firefox 10 or later&#8230;)</li>
<li><a href="https://github.com/Pollenware/comb">Comb</a> looks like a nice toolbox of utilities for creating node.js applications, including helpers for logging, collections and flow control.</li>
<li>Peter Lubbers HTML Offline Web Apps Presentation. HTML5 &#8220;Off line&#8221;" can be as tricky as it is powerful. Check out this <a href="http://www.slideshare.net/skillsmatter/peter-lubbershtml5offlinewebapps">great introduction</a>!</li>
<li>If you use <a href="http://www.sublimetext.com/2">Sublime Text 2</a> for programming then you&#8217;ll love this <a href="http://wbond.net/sublime_packages/community">huge list of packages</a> that extend the code editor in various ways.</li>
<li>This article is not directly to Web development, but to something close to our hearts and even closer to our wallets: monetization. <a href="http://www.elezea.com/2011/12/facebook-ads-and-you/">Everything for free, always: how Facebook ads show us the sad state of the Internet</a>. In short, close to one billion people are willing to leave a large organization know everything about them in order to access a service that costs roughly 3 dollars a year. It says a lot about the monetization issue on the Web. Aiming to fix this, Mozilla&rsquo;s working on <a href="http://hacks.mozilla.org/2011/12/mozilla-labs-apps-preview/">Mozilla Labs Apps Preview</a>, which could also become useful for  <a href="http://hacks.mozilla.org/2011/12/gaming-and-the-mozilla-labs-apps-project/">games</a>!</li>
<li><a href="http://line25.com/articles/10-usability-crimes-you-really-shouldnt-commit">10 Usability Crimes You Really Shouldn&rsquo;t Commit</a> &#8211; A collection of ten simple but important usability tips for web developers young and old.</li>
</ul>
<h2>The Developer Engagement team</h2>
<p>Mozilla&#8217;s Developer Engagement team work with writing articles, documentation &#8211; such as <a href="https://developer.mozilla.org/">MDN (Mozilla Developer Network)</a> &#8211; public speaking and generally helping and informing about open technologies and Mozilla products. If you are interested in following our work, here are the team members:</p>
<section class="hw-team">
<div class="hw-team-member">
<h3>Barry Munsterteiger</h3>
<p>        <img src="http://hacks.mozilla.org/wp-content/uploads/2012/02/barry.jpg" alt=""> Barry is our Creative Instigator and is working on interesting and limit-breaking demos.</p>
<p>        Twitter: <a href="https://twitter.com/mozbarry">@mozBarry</a>
    </div>
<div class="hw-team-member">
<h3>Christian Heilmann</h3>
<p>        <img src="http://hacks.mozilla.org/wp-content/uploads/2011/08/chris-heilmann.jpg" alt=""> Christian is Mozilla&#8217;s Principal Evangelist and is working with HTML5, Open Web, <a href="https://browserid.org/">BrowserID</a> and <a href="https://wiki.mozilla.org/DevTools">Developer Tools in Firefox</a>. He is also maintaining the <a href="https://twitter.com/mozhacks">@mozhacks</a> account together with Robert Nyman.</p>
<p>        Blog: <a href="http://christianheilmann.com/">http://christianheilmann.com/</a><br />
        Twitter: <a href="http://twitter.com/codepo8">@codepo8</a>
    </div>
<div class="hw-team-member">
<h3>Eric &#8220;Sheppy&#8221; Shepherd</h3>
<p>        <img src="http://hacks.mozilla.org/wp-content/uploads/2011/09/eric-shepherd.jpg" alt=""> Eric is the Developer Documentation Lead for the MDN documentation and everything surrounding it. </p>
<p>        Blog: <a href="http://www.bitstampede.com/">http://www.bitstampede.com/</a><br />
        Twitter: <a href="http://twitter.com/sheppy">@sheppy</a>
    </div>
<div class="hw-team-member">
<h3>Havi Hoffman</h3>
<p>        <img src="http://hacks.mozilla.org/wp-content/uploads/2011/08/havi-hoffman.jpg" alt=""> Havi works with <a href="http://mozillalabs.com/">Mozilla Labs</a> and <a href="https://webfwd.org/">WebFWD</a>, and maintains the <a href="http://twitter.com/mozlabs">@mozlabs</a> account.</p>
<p>        Twitter: <a href="http://twitter.com/freshelectrons">@freshelectrons</a>.
    </div>
<div class="hw-team-member">
<h3>Janet Swisher</h3>
<p>        <img src="http://hacks.mozilla.org/wp-content/uploads/2011/08/janet-swisher.jpeg" alt=""> Janet is working on MDN documentation and is organizing doc sprints to ensure we have premium quality on MDN.</p>
<p>        Blog: <a href="http://www.janetswisher.com/">http://www.janetswisher.com/</a><br />
        Twitter: <a href="http://twitter.com/jmswisher">@jmswisher</a>.
    </div>
<div class="hw-team-member">
<h3>Jean-Yves Perrier</h3>
<p>        <img src="http://hacks.mozilla.org/wp-content/uploads/2011/12/Jean-yves-perrier.png" alt=""> Jean-Yves is another one of our technical writers working on MDN documentation.</p>
<p>        Twitter: <a href="http://twitter.com/@teoli2003">@teoli2003</a>.
    </div>
<div class="hw-team-member">
<h3>Jeff Griffiths</h3>
<p>        <img src="http://hacks.mozilla.org/wp-content/uploads/2011/11/jeff-griffiths.jpg" alt=""> Jeff is working with the <a href="https://wiki.mozilla.org/Jetpack">Add-ons SDK (Jetpack)</a>.</p>
<p>        Blog: <a href="http://canuckistani.ca/">http://canuckistani.ca/</a><br />
        Twitter: <a href="http://twitter.com/canuckistani">@canuckistani</a>
    </div>
<div class="hw-team-member">
<h3>Joe Stagner</h3>
<p>        <img src="http://hacks.mozilla.org/wp-content/uploads/2011/09/joe-stagner-cartoon.gif" alt=""> Joe is working with <a href="https://apps.mozillalabs.com/">Web Apps</a> Developer Ecosystem &amp; Partner Engagement, HTML5 and the Open Web.</p>
<p>        Blog: <a href="http://www.misfitgeek.com/">http://www.misfitgeek.com/</a><br />
        Twitter: <a href="http://twitter.com/MisfitGeek">@MisfitGeek</a>
    </div>
<div class="hw-team-member">
<h3>John Karahalis</h3>
<p>        <img src="http://hacks.mozilla.org/wp-content/uploads/2011/08/john-karahalis.jpg" alt=""> John is working on <a href="https://developer.mozilla.org/demos/devderby">Dev Derby</a>.</p>
<p>        Twitter: <a href="http://twitter.com/openjck">@openjck</a>
    </div>
<div class="hw-team-member">
<h3>Rob Hawkes</h3>
<p>        <img src="http://hacks.mozilla.org/wp-content/uploads/2011/07/rob-hawkes.jpg" alt=""> Rob is working on <a href="https://wiki.mozilla.org/HTML5_Games">HTML5 games</a> and the Open Web.</p>
<p>        Blog: <a href="http://rawkes.com/">http://rawkes.com/</a><br />
        Twitter: <a href="http://twitter.com/robhawkes">@robhawkes</a>
    </div>
<div class="hw-team-member">
<h3>Robert Nyman</h3>
<p>        <img src="http://hacks.mozilla.org/wp-content/uploads/2011/07/robert-nyman.jpg" alt=""> Robert is working with HTML5, Open Web, <a href="http://www.mozilla.com/firefox/">Firefox</a>, <a href="https://wiki.mozilla.org/WebAPI">WebAPI</a> and maintains the <a href="https://twitter.com/mozhacks">@mozhacks</a> account.</p>
<p>        Blog: <a href="http://robertnyman.com">http://robertnyman.com</a><br />
        Twitter: <a href="http://twitter.com/robertnyman">@robertnyman</a>
    </div>
<div class="hw-team-member">
<h3>Shezmeen Prasad</h3>
<p>        <img src="http://hacks.mozilla.org/wp-content/uploads/2012/02/shez.jpg" alt=""> Shezmeen is working on everything regarding events, organization and connecting conferences with Mozilla speakers.
    </div>
<div class="hw-team-member">
<h3>Stormy Peters</h3>
<p>        <img src="http://hacks.mozilla.org/wp-content/uploads/2011/07/stormy-peters.jpg" alt=""> Stormy is the Team Lead for the Developer Engagement team. managing it and evaluating our objectives.</p>
<p>        Blog: <a href="http://stormyscorner.com/">http://stormyscorner.com/</a><br />
        Twitter: <a href="http://twitter.com/storming">@storming</a>
    </div>
<div class="hw-team-member">
<h3>Tristan Nitot</h3>
<p>        <img src="http://hacks.mozilla.org/wp-content/uploads/2011/08/tristan-nitot.jpg" alt=""> Tristan is our <a href="http://hacks.mozilla.org/category/missionmozilla/">Mission Evangelist</a> and is focusing on the bigger picture of Mozilla.</p>
<p>        Blog: <a href="http://standblog.org/blog/en">http://standblog.org/blog/en</a><br />
        Twitter: <a href="http://twitter.com/nitot">@nitot</a>
    </div>
<div class="hw-team-member">
<h3>Will Bamberg</h3>
<p>        <img src="http://hacks.mozilla.org/wp-content/uploads/2011/07/will-bamberg.jpg" alt="A picture of Will Bamberg"> Will is working on documentation for the <a href="https://wiki.mozilla.org/Jetpack">Add-ons SDK (Jetpack)</a>.
    </div>
</section>
<style>
    .hw-team {overflow: hidden;}
    .hw-team-member { float: right; width: 45%; overflow: hidden; margin-bottom: 15px; }
    .hw-team-member:nth-child(odd) { float: left; clear: both;}
    .hw-team-member img { display: block; margin-bottom: 10px; }
</style>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2012/02/mozilla-hacks-weekly-february-2nd-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>State of the Docs, Feb. 1, 2012</title>
		<link>http://hacks.mozilla.org/2012/02/state-of-the-docs-feb-1-2012/</link>
		<comments>http://hacks.mozilla.org/2012/02/state-of-the-docs-feb-1-2012/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 23:53:55 +0000</pubDate>
		<dc:creator>Janet Swisher</dc:creator>
				<category><![CDATA[Docs]]></category>
		<category><![CDATA[MDN]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=11129</guid>
		<description><![CDATA[Here are some of the changes to the Mozilla Developer Network site in the week and a half since the recent doc sprint. Infrastructure woes We had a snafu for a few days last week when a server crashed in the middle of a move of the DOM reference hierarchy, causing many DOM reference pages [...]]]></description>
			<content:encoded><![CDATA[<p>Here are some of the changes to the <a href="https://developer.mozilla.org">Mozilla Developer Network</a> site in the week and a half since the recent doc sprint.</p>
<h2>Infrastructure woes</h2>
<p>We had a snafu for a few days last week when a server crashed in the middle of a move of the DOM reference hierarchy, causing many DOM reference pages to apparently disappear. That situation has now been fixed.</p>
<p>We have a recurring issue with the wiki software, where the syntax highlighting extension fails to load, causing an error message to appear in place of code examples. While we wait for a patch to be backported by the vendor, we have a script in place that detects this situation and corrects it. While you might still occasionally see those error messages, they should be less frequent and persistent than previously.</p>
<h2>Web standards docs</h2>
<ul>
<li><strong>Eric Bidelman</strong> updated the <a href="https://developer.mozilla.org/en/API/Mouse_Lock_API">Mouse Lock API</a>.</li>
<li><strong>Luke Crouch</strong> added an Apache example to <a href="https://developer.mozilla.org/En/Server-Side_Access_Control">Server-side access control</a>.</li>
<li><strong>fusionchess</strong> added a compatibility workaround for the JavaScript <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/JSON">JSON global object</a>.</li>
<li><strong>Has Hillen</strong> expanded the ARIA technique article on <a href="https://developer.mozilla.org/en/ARIA/ARIA_Techniques/Using_the_dialog_role">Using the dialog role</a>.</li>
<li><strong>Burak Yigit Kaya</strong> added a JSFiddle example to <a href="https://developer.mozilla.org/en/HTML_in_XMLHttpRequest">HTML in XMLHttpRequest</a>.</li>
<li><strong>Gijs Kruitbosch</strong> added a compatibility table to <a href="https://developer.mozilla.org/en/DOM/window.frameElement">window.frameElement</a>.</li>
<li><strong>Jeremie Patonnier</strong> updated <a href="https://developer.mozilla.org/en/DOM/DOMParser">DOMParser</a> to cover parsing HTML fragments.</li>
<li><strong>Eric Shepherd</strong> documented the DOM <a href="https://developer.mozilla.org/en/DOM/console">console</a> and related objects.</li>
<li><strong>yyss</strong> translated a number of pages into Japanese, related to <a href="https://developer.mozilla.org/en/JavaScript_typed_arrays">JavaScript typed arrays</a>, <a href="https://developer.mozilla.org/en/DOM/Using_full-screen_mode">full-screen mode</a>, WebGL, and writing forward-compatible websites.</li>
</ul>
<h2>Mozilla-specific docs</h2>
<ul>
<li><strong>Wolfgang Germund</strong> updated <a href="https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIZipReader">nsIZioReader</a> and <a href="https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIZipReaderCache">nsIZipReaderCache</a>.</li>
<li><strong>Sam Hanes</strong> updated <a href="https://developer.mozilla.org/en/Document_Loading_-_From_Load_Start_to_Finding_a_Handler">Document Loading &#8211; From Load Start to Finding a Handler</a>. The diagram in this article still needs to be updated.</li>
<li><strong>Anthony Hughes</strong> documented <a href="https://developer.mozilla.org/en/Mozmill_Tests/Branch_Merge/Merging_ESR_Branch">Merging the ESR branch</a>.</li>
<li><strong>Nickolay Ponomarev</strong> added a list of mouse gesture events to <a href="https://developer.mozilla.org/en/Gecko-Specific_DOM_Events">Gecko-specific DOM events</a>.</li>
<li><strong>Colby Russell</strong> expanded <a href="https://developer.mozilla.org/en/DOM_Inspector/Internals">DOM Inspector internals</a>.</li>
<li><strong>Eric Shepherd</strong> beefed up the coverage of the <a href="https://developer.mozilla.org/en/Tools/Web_Console">Web console</a>.</li>
<li><strong>Sid0</strong> update the article on <a href="https://developer.mozilla.org/En/Windows_SDK_versions">Windows SDK versions</a>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2012/02/state-of-the-docs-feb-1-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating thumbnails with drag and drop and HTML5 canvas</title>
		<link>http://hacks.mozilla.org/2012/02/creating-thumbnails-with-drag-and-drop-and-html5-canvas/</link>
		<comments>http://hacks.mozilla.org/2012/02/creating-thumbnails-with-drag-and-drop-and-html5-canvas/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 14:00:28 +0000</pubDate>
		<dc:creator>Janet Swisher</dc:creator>
				<category><![CDATA[Canvas]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[Featured Demo]]></category>
		<category><![CDATA[FileAPI]]></category>
		<category><![CDATA[HTML5]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=11119</guid>
		<description><![CDATA[HTML5 Canvas is a very cool feature. Seemingly just an opportunity to paint inside the browser with a very low-level API you can use it to heavily convert and change image and video content in the document. Today, let&#8217;s take a quick look at how you can use Canvas and the FileReader API to create [...]]]></description>
			<content:encoded><![CDATA[<p>HTML5 Canvas is a very cool feature. Seemingly just an opportunity to paint inside the browser with a very low-level API you can use it to heavily convert and change image and video content in the document. Today, let&#8217;s take a quick look at how you can use Canvas and the FileReader API to create thumbnails from images dropped into a browser document.</p>
<p>The <a href="https://github.com/codepo8/canvasthumber">final code is available on GitHub</a> and you can see an <a href="http://thewebrocks.com/demos/canvasthumber/">online demo here</a>. There is also a screencast available on YouTube:</p>
<p><iframe width="500" height="284" src="http://www.youtube.com/embed/cYN45FixIgI?rel=0" frameborder="0" allowfullscreen></iframe></p>
<h2>Step 1: Getting the files into the browser</h2>
<p>The first step to resize images in the browser is to somehow get them. For this, we can just add an element in the page and assign drag and drop event handlers to it:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">s.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'dragover'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span> evt <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  evt.<span style="color: #660066;">preventDefault</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
s.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'drop'</span><span style="color: #339933;">,</span> getfiles<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Notice that we only prevent the default behaviour when we drag things over the element. This is to prevent the browser from just showing the images when we drag them in. </p>
<p>The <code>getfiles()</code> function then does the hard work of reading all the files in and sending them on to the functions that do the resizing and image generation:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> getfiles<span style="color: #009900;">&#40;</span> ev <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> files <span style="color: #339933;">=</span> ev.<span style="color: #660066;">dataTransfer</span>.<span style="color: #660066;">files</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> files.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> files.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span> i<span style="color: #339933;">--</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #003366; font-weight: bold;">var</span> file <span style="color: #339933;">=</span> files<span style="color: #009900;">&#91;</span> i <span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> file.<span style="color: #660066;">type</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'image'</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000066; font-weight: bold;">continue</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
      <span style="color: #003366; font-weight: bold;">var</span> reader <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> FileReader<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      reader.<span style="color: #660066;">readAsDataURL</span><span style="color: #009900;">&#40;</span> file <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      reader.<span style="color: #000066;">onload</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span> ev <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> img <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Image<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        img.<span style="color: #660066;">src</span> <span style="color: #339933;">=</span> ev.<span style="color: #660066;">target</span>.<span style="color: #660066;">result</span><span style="color: #339933;">;</span>
        img.<span style="color: #000066;">onload</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        imagetocanvas<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span> thumbwidth<span style="color: #339933;">,</span> thumbheight<span style="color: #339933;">,</span> crop<span style="color: #339933;">,</span> background <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
  ev.<span style="color: #660066;">preventDefault</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The <code>drop</code> event gives us a property called <code>dataTransfer</code> which contains a list of all the files that have been dropped. We make sure that there was at least one file in the drop and then iterate over them.</p>
<p>If the file type was not an image (or in other words the type property of the file does not contain the string &#8220;image&#8221;) we don&#8217;t do anything with the file and continue the loop.</p>
<p>If the file is an image we instantiate a new <code>FileReader</code> and tell it to read the file as a Data URL. When the reader successfully loaded the file it fires its <code>onload</code> handler.</p>
<p>In this handler we create a new image and set its <code>src</code> attribute to the <code>result</code> of the file transfer. We then send this image to the <code>imagetocanvas()</code> function with the parameters to resize (in the demo these come from the form):</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> imagetocanvas<span style="color: #009900;">&#40;</span> img<span style="color: #339933;">,</span> thumbwidth<span style="color: #339933;">,</span> thumbheight<span style="color: #339933;">,</span> crop<span style="color: #339933;">,</span> background <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  c.<span style="color: #660066;">width</span> <span style="color: #339933;">=</span> thumbwidth<span style="color: #339933;">;</span>
  c.<span style="color: #660066;">height</span> <span style="color: #339933;">=</span> thumbheight<span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> dimensions <span style="color: #339933;">=</span> resize<span style="color: #009900;">&#40;</span> img.<span style="color: #660066;">width</span><span style="color: #339933;">,</span> img.<span style="color: #660066;">height</span><span style="color: #339933;">,</span> thumbwidth<span style="color: #339933;">,</span> thumbheight <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> crop <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    c.<span style="color: #660066;">width</span> <span style="color: #339933;">=</span> dimensions.<span style="color: #660066;">w</span><span style="color: #339933;">;</span>
    c.<span style="color: #660066;">height</span> <span style="color: #339933;">=</span> dimensions.<span style="color: #660066;">h</span><span style="color: #339933;">;</span>
    dimensions.<span style="color: #660066;">x</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
    dimensions.<span style="color: #660066;">y</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> background <span style="color: #339933;">!==</span> <span style="color: #3366CC;">'transparent'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    cx.<span style="color: #660066;">fillStyle</span> <span style="color: #339933;">=</span> background<span style="color: #339933;">;</span>
    cx.<span style="color: #660066;">fillRect</span> <span style="color: #009900;">&#40;</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> thumbwidth<span style="color: #339933;">,</span> thumbheight <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  cx.<span style="color: #660066;">drawImage</span><span style="color: #009900;">&#40;</span> 
    img<span style="color: #339933;">,</span> dimensions.<span style="color: #660066;">x</span><span style="color: #339933;">,</span> dimensions.<span style="color: #660066;">y</span><span style="color: #339933;">,</span> dimensions.<span style="color: #660066;">w</span><span style="color: #339933;">,</span> dimensions.<span style="color: #660066;">h</span> 
  <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  addtothumbslist<span style="color: #009900;">&#40;</span> jpeg<span style="color: #339933;">,</span> quality <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This function gets the desired thumbnail size and resizes the canvas to these dimensions. This has the added benefit of wiping the canvas so that no old image data would be added to our thumbnail. We then resize the image to fit into the thumbnail using a <code>resize()</code> function. You can see for yourself what this one does in the source code, it just means the image gets resized to fit. The function returns an object with the width and the height of the new image and the x and y position where it should be positioned onto the canvas. </p>
<p>If we don&#8217;t want the full-size thumbnail but instead crop it we resize the canvas accordingly and reset x and y to 0.</p>
<p>If the user requested a background we fill the canvas with the colour. After that we put the image on the canvas with the x and y coordinates and the new width and height. </p>
<p>This takes care of creating a new thumbnail on the canvas, but we haven&#8217;t got it as an image in the document yet. To this end, we call  <code>addtothumbslist()</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> addtothumbslist<span style="color: #009900;">&#40;</span> jpeg<span style="color: #339933;">,</span> quality <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> thumb <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Image<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
      url <span style="color: #339933;">=</span> jpeg <span style="color: #339933;">?</span> c.<span style="color: #660066;">toDataURL</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'image/jpeg'</span> <span style="color: #339933;">,</span> quality <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> c.<span style="color: #660066;">toDataURL</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  thumb.<span style="color: #660066;">src</span> <span style="color: #339933;">=</span> url<span style="color: #339933;">;</span>
  thumb.<span style="color: #660066;">title</span> <span style="color: #339933;">=</span> Math.<span style="color: #660066;">round</span><span style="color: #009900;">&#40;</span> url.<span style="color: #660066;">length</span> <span style="color: #009966; font-style: italic;">/ 1000 * 100 ) /</span> <span style="color: #CC0000;">100</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">' KB'</span><span style="color: #339933;">;</span>
  o.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span> thumb <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This one creates a new image and checks if the users wanted a JPG or PNG image to be created. PNG images tend to be better quality but also bigger in file size. If a JPG was requested we call the canvas&#8217; <code>toDataURL()</code> method with two parameters: the requested JPEG mime type and the quality of the image (ranging between 0 and 1 with 1 being best quality). If a PNG is wanted, we can just call <code>toDataURL()</code> without any parameters as this is the default.</p>
<p>We set the <code>src</code> of the image to the  generated url string and add a title showing the size of the image in KB (rounded to two decimals). All that is left then is to add the thumb to the output element on the page.</p>
<p>That&#8217;s it, you can now drag and drop images into the browser to generate thumbnails. Right now, we can only save them one at a time (or if you have some download add-ons all at once). Would be fun to add <a href="gildas-lormeau.github.com/zip.js/">Zip.js</a> to the mix to offer them as a zip. I dare you! :)</p>
<p>More reading:</p>
<ul>
<li><a href="https://developer.mozilla.org/en/DragDrop/Drag_and_Drop">Drag and Drop</a> on MDN</a></li>
<li><a href="https://developer.mozilla.org/en/DOM/FileReader">FileReader</a> on MDN</a></li>
<li><a href="https://developer.mozilla.org/en/HTML/Canvas">Canvas</a> on MDN</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2012/02/creating-thumbnails-with-drag-and-drop-and-html5-canvas/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Interview: Nikhil Suresh on Building His Winning Canvas Demo</title>
		<link>http://hacks.mozilla.org/2012/01/interview-nikhil-suresh-on-building-his-winning-canvas-demo/</link>
		<comments>http://hacks.mozilla.org/2012/01/interview-nikhil-suresh-on-building-his-winning-canvas-demo/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 05:36:48 +0000</pubDate>
		<dc:creator>Janet Swisher</dc:creator>
				<category><![CDATA[Canvas]]></category>
		<category><![CDATA[Dev Derby]]></category>
		<category><![CDATA[Gaming]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=11033</guid>
		<description><![CDATA[Editor&#8217;s Note: Back in November, Nikhil Suresh (@nklsrh2) from Sydney, Australia, won the MDN Developer Derby with his distinctive, non-violent 2-person shooter game Bouncy and the Apple. We thought it&#8217;d be fun to learn a little more about Nikhil and what inspires him. Congratulations Nikhil, and thanks for your thoughtful words about Mozilla. We&#8217;re honored [...]]]></description>
			<content:encoded><![CDATA[<p><em>Editor&#8217;s Note: Back in <a href="https://developer.mozilla.org/demos/devderby/2011/november/">November</a>, <a href="https://developer.mozilla.org/en-US/profiles/nklsrh/">Nikhil Suresh</a> (<a href="http://www.twitter.com/nklsrh2">@nklsrh2</a>) from Sydney, Australia, won the <a href="https://developer.mozilla.org/en-US/demos/devderby">MDN Developer Derby</a> with his distinctive, non-violent 2-person shooter game <a href="https://developer.mozilla.org/en-US/demos/detail/bouncy-and-the-apple">Bouncy and the Apple</a>. We thought it&#8217;d be fun to learn a little more about Nikhil and what inspires him.<br />
Congratulations Nikhil, and thanks for your thoughtful words about Mozilla. We&#8217;re honored to showcase your demo.</em><br />
<a href="http://hacks.mozilla.org/2012/01/interview-nikhil-suresh-on-building-his-winning-canvas-demo/nikhil-5/" rel="attachment wp-att-11058"><img src="http://hacks.mozilla.org/wp-content/uploads/2012/01/nikhil4-250x374.jpg" alt="Nikhil Suresh" title="nikhil" width="250" height="374" class="alignright size-medium wp-image-11058" /></a><br />
<strong>Tell us about developing <em>Bouncy and the Apple</em> and where your idea came from?</strong></p>
<p>I really wanted my demo to stand out from the crowd, so it had to possess a singular feature that would impress. Since my passion is game development, I decided to implement game controller support in whatever game I would build for the Derby. I built Bouncy to be a twin-stick shooter which would stand out as a demo for the <a href="https://wiki.mozilla.org/GamepadAPI">Mozilla Gamepad API</a> as well as Canvas.</p>
<p>Usually, I tend to stay away from violence in my games, so it was a bit difficult at first (a ‘shooter’ without any violence!)</p>
<p>Incidentally, it was the Mozilla mascots that inspired me to draw Bouncy (the spikes in the hair were directly from the brown dude with the hat!): </p>
<p><a href="http://www.mozilla.org/en-US/firefox/brand/"><img src="http://hacks.mozilla.org/wp-content/uploads/2012/01/illustrations-characters-500x364.png" alt="Mozilla Brand Toolkit images" title="illustrations-characters" width="500" height="364" class="aligncenter size-large wp-image-11093" /></a></p>
<p><strong><br />
How did you get started coding and hacking?</strong></p>
<p>Funnily enough, it started in Microsoft PowerPoint, where I realized I could &#8216;hyperlink&#8217; from a slide to any other one. I then created a quiz game, not unlike the TV show &#8216;Who wants to be a Millionaire?.&#8217; From that, I moved onto Visual Basic (in which I became Microsoft-Certified in 2008) C# and XNA, and eventually began learning JavaScript (after playing around with the Processing language).</p>
<p><strong>What was your first computer?</strong></p>
<p>I don’t really remember much about my first computer, except the fact it had a Pentium II, which was not powerful enough to run some of the new games I wanted to play.<br />
<strong><br />
What games do you play the most these days?</strong></p>
<p>On the console, I prefer racing games like <a href="http://www.formula1-game.com/uk/">F1 2011</a> and <a href="http://www.gran-turismo.com/">Gran Turismo</a>. On the PC, I like to play indie games like <a href="http://supercratebox.com ">Super Crate Box</a> and <a href="http://finalformgames.com/jamestown/">Jamestown</a>. I also love Valve games like Portal.</p>
<p><strong>Are you working on another demo or any other cool projects you want to share?</strong></p>
<p>I&#8217;m currently participating in the <a href="http://www.pokki.com/1up/">Pokki 1UP game development competition</a>, with a friend. We are building a 2D/3D arcade game called BLASTR:ARENA. It uses <a href="http://en.wikipedia.org/wiki/WebGL">WebGL</a> for 3D graphics and <a href="https://developer.mozilla.org/en/Canvas_tutorial">Canvas</a> for the 2D fallback.</p>
<p><a href="http://hacks.mozilla.org/2012/01/interview-nikhil-suresh-on-building-his-winning-canvas-demo/11-2-2/" rel="attachment wp-att-11066"><img src="http://hacks.mozilla.org/wp-content/uploads/2012/01/11-21-500x281.png" alt="Blastrs Game in development " title="Blastrs screengrab" width="500" height="281" class="aligncenter size-large wp-image-11066" /></a></p>
<p><strong>You mentioned that you recently graduated from high school? What&#8217;s next for you?</strong></p>
<p>I have just enrolled in the Bachelor of Engineering (Software) course at the University of New South Wales. During my degree, I will also be developing games part-time, hopefully for a chance at breaking into the gamedev industry.</p>
<p><strong>When you think about HTML5 and new Web technologies what are you most excited about?</strong></p>
<p>As my game clearly demonstrates, HTML5 and other web technologies provide the browser the ability to render other traditional applications obsolete, replacing them with a unified system which can serve as the basis for anything from games to word processors.</p>
<p>As I’m most interested in game development, the introduction of the <a href="https://hacks.mozilla.org/2012/01/using-the-fullscreen-api-in-web-browsers/">Fullscreen</a> and <a href="https://developer.mozilla.org/en/API/Gamepad/Using_Gamepad_API">Gamepad APIs</a>, as well as performance increases in WebGL and Canvas give the Web a greater chance of overthrowing consoles as an effective game platform.</p>
<p><strong>Anybody else who helped you with Bouncy and the Apple whom you&#8217;d like to give a shout out to?</strong> </p>
<p>My aunt, who had come over for a holiday, was a fantastic source of inspiration and ideas, so it was a great feeling to finally play <a href="http://www.youtube.com/watch?v=TOTi1fPWVeA&#038;feature=player_embedded">the finished game</a> with her on the big screen. I’d also like to thank my parents for letting me stick to my plans, even if I skipped dinner and stayed up until 1AM on some nights. I’m also grateful to my brother for putting up with my endless repeating game music. </p>
<p><strong>You mentioned that you&#8217;re a big fan of Mozilla&#8217;s work on the Open Web. Can you say something more about why you think that&#8217;s important?</strong></p>
<p>I think Mozilla is a fantastic, one-of-a-kind organisation since it works and innovates solely with the well-being of the Web and its users in mind. With such an open and direct goal, it means everyone, from the users to the developers, benefit from the development of Mozilla products and technologies.<br />
Also, Mozilla’s work on HTML, CSS, Javascript and other web technology is for the mutual benefit of all, fostering the advancement of the open Web as a mainstream platform of the present and future generations.</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2012/01/interview-nikhil-suresh-on-building-his-winning-canvas-demo/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Mozilla joins the W3C DAP &#8211; WebAPI progress</title>
		<link>http://hacks.mozilla.org/2012/01/mozilla-joins-the-w3c-dap-webapi-progress/</link>
		<comments>http://hacks.mozilla.org/2012/01/mozilla-joins-the-w3c-dap-webapi-progress/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 13:27:47 +0000</pubDate>
		<dc:creator>Robert Nyman</dc:creator>
				<category><![CDATA[WebAPI]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=10998</guid>
		<description><![CDATA[When we originally introduced our work on WebAPI, we got a number of questions where a particular question was the most frequently asked. Now, four months later, we wanted to follow up with what has been happening since. The question people asked was about the relation between Mozilla WebAPI and W3C DAP, what our stance [...]]]></description>
			<content:encoded><![CDATA[<p>When we originally <a href="http://hacks.mozilla.org/2011/08/introducing-webapi/">introduced our work on WebAPI</a>, we got a number of questions where a particular question was the most frequently asked. Now, four months later, we wanted to follow up with what has been happening since.</p>
<p><span id="more-10998"></span></p>
<p>The question people asked was about the relation between Mozilla WebAPI and <a href="http://www.w3.org/2009/dap/">W3C DAP</a>, what our stance on DAP is and if we were just creating another standards body. From the get go, we declared our commitment and <a href="http://hacks.mozilla.org/2011/08/more-details-about-the-webapi-effort/">intent to contribute to existing standards</a>. </p>
<p>Mozilla has a long history working with W3C and continues to be a member in several W3C working groups. However, at the time we had concerns about some of the work happening in DAP. Since then, DAP has focused their efforts on technologies appropriate for implementation in web browsers and so we&#8217;ve have decided that it&#8217;s worth joining that working group. Our developers Jonas Sicking and Mounir Lamouri have now joined DAP to ease the collaboration and contribution. </p>
<p>What this means in practice is that we test and develop things, and when we feel that it is ready, or even suitable, to become a standard and continue to evolve, we submit it to W3C. Like most companies, we need to evaluate, examine and prototype different ideas all the time, but what might be different about us is that our process is open to the world to see, ask about and also contribute to.</p>
<p>Even before this, we have submitted the <a href="http://www.w3.org/TR/battery-status/">Battery API</a> and the <a href="http://www.w3.org/TR/vibration/">Vibration API</a> to DAP, which are both pretty far along in standardization. We look forward to continue to do so with APIs as they get mature enough.</p>
<p>If you are interested in following or taking part of the work with our different APIs, feel more than welcome to follow any of these channels:</p>
<ul>
<li><a href="https://wiki.mozilla.org/WebAPI">WebAPI project page</a>.</li>
<li><a href="http://groups.google.com/group/mozilla.dev.webapi/topics">The WebAPI mailing list</a>.</li>
<li>IRC: <a href="http://irc.mozilla.org/">irc.mozilla.org</a> in the #webapi room.</li>
</ul>
<p>Please also ask any questions you might have in the comments here, and we&#8217;ll do our best to reply to them.</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2012/01/mozilla-joins-the-w3c-dap-webapi-progress/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Using the Fullscreen API in web browsers</title>
		<link>http://hacks.mozilla.org/2012/01/using-the-fullscreen-api-in-web-browsers/</link>
		<comments>http://hacks.mozilla.org/2012/01/using-the-fullscreen-api-in-web-browsers/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 17:38:18 +0000</pubDate>
		<dc:creator>Robert Nyman</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Firefox 10]]></category>
		<category><![CDATA[Web Developers]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=11021</guid>
		<description><![CDATA[One thing which has been very important when it comes to creating special end user experiences have been the ability to show something fullscreen, effectively hiding all the other content etc. Remember when web sites gave you instructions how to configure your web browser with hiding toolbars and more, just to get a slightly better [...]]]></description>
			<content:encoded><![CDATA[<p>One thing which has been very important when it comes to creating special end user experiences have been the ability to show something fullscreen, effectively hiding all the other content etc.</p>
<p><span id="more-11021"></span></p>
<p>Remember when web sites gave you instructions how to configure your web browser with hiding toolbars and more, just to get a slightly better user experience? Or maybe it&#8217;s just me… :-)</p>
<p>Either way, some time ago we got fullscreen support in web browsers where the user could choose to view the current web site in fullscreen. That&#8217;s all good and well, but as an extension to that, as web developers we want to be able to trigger that. Either for the entire web site or just a specific element.</p>
<p>And now we can!</p>
<h2>Requesting fullscreen</h2>
<p>We now have access to a method called <code>requestFullScreen</code>, so far implemented in Firefox, Google Chrome and Safari. Therefore, to make it work at the moment, we need this code:</p>
<p><script src="https://gist.github.com/1704368.js?file=Fullscreen%20API"></script><br />
<noscript><br />
    <code>var docElm = document.documentElement;<br />
if (docElm.requestFullscreen) {<br />
    docElm.requestFullScreen();<br />
}<br />
else if (docElm.mozRequestFullscreen) {<br />
    docElm.mozRequestFullScreen();<br />
}<br />
else if (docElm.webkitRequestFullScreen) {<br />
    docElm.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);<br />
}</code><br />
</noscript></p>
<p>Please note that the <a href="http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html">Fullscreen standard in the W3C specification</a> uses a lowercase &#8216;s&#8217; in all methods, whereas Firefox, Google Chrome and Safari use an uppercase one.</p>
<p>What the code above does is just getting a reference to the documentElement and request for it to be displayed fullscreen. Naturally, you could also make just a certain element fullscreen, for instance, a video, with the same method called for the element you wish.</p>
<h2>Cancelling fullscreen</h2>
<p>If you want to cancel the fullscreen state, you need to call it on the document element:</p>
<p><script src="https://gist.github.com/1705463.js"></script><br />
<noscript><br />
    <code>if (document.exitFullscreen) {<br />
    document.exitFullscreen();<br />
}<br />
else if (document.mozCancelFullScreen) {<br />
    document.mozCancelFullScreen();<br />
}<br />
else if (document.webkitCancelFullScreen) {<br />
    document.webkitCancelFullScreen();<br />
}</code><br />
</noscript></p>
<p>Note here that W3C has decided to call it <code>exitFullscreen</code>, but in all existing web browser implementations it&#8217;s about cancelling the state.</p>
<h2>Detecting fullscreen state change</h2>
<p>The user could, for instance, exit fullscreen, something that might be good for you to know. For that we have a <code>fullscreenchange</code> event, that you can apply both to the element that requested fullscreen, but also to the document. Then we just detect the fullscreen state and take act accordingly, like this:</p>
<p><script src="https://gist.github.com/1705516.js"></script><br />
<noscript><code>document.addEventListener("fullscreenchange", function () {<br />
    fullscreenState.innerHTML = (document.fullscreen)? "" : "not ";<br />
}, false);</p>
<p>document.addEventListener("mozfullscreenchange", function () {<br />
    fullscreenState.innerHTML = (document.mozFullScreen)? "" : "not ";<br />
}, false);</p>
<p>document.addEventListener("webkitfullscreenchange", function () {<br />
    fullscreenState.innerHTML = (document.webkitIsFullScreen)? "" : "not ";<br />
    }, false);</code></noscript></p>
<h2>Styling fullscreen</h2>
<p>In CSS, we get a number of pseudo-classes for styling fullscreen elements. The most reliable one is for full-screen and automatically gets triggered when the document/element is in fullscreen mode:</p>
<p><script src="https://gist.github.com/1705528.js"></script><br />
<noscript><code>html:-moz-full-screen {<br />
    background: red;<br />
}</p>
<p>html:-webkit-full-screen {<br />
    background: red;<br />
}</p>
<p>html:fullscreen {<br />
    background: red;<br />
}</code></noscript></p>
<p>Notice here that the W3C approach doesn&#8217;t use a hyphen between the word &#8216;full&#8217; and the word &#8216;screen&#8217;.</p>
<p>It should also be added that Firefox is the only web browser that applies a width and height of 100% to the element that is requesting fullscreen, since we believe that is the desired behavior. This can of course be overridden with the above CSS.</p>
<h2>Full screen with key input</h2>
<p>For security reasons, most keyboard inputs have been blocked in the fullscreen mode. However, in Google Chrome you can request keyboard support by calling the method with a flag:</p>
<p><code>docElm.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);</code></p>
<p>This does not work in Safari, and the method won&#8217;t be called.</p>
<p>With Firefox, we are discussing and looking into various ways of how we we could add keyboard input support without jeopardizing the end user&#8217;s security. One suggestion, that no one has implemented yet, is the <code>requestFullscreenWithKeys</code> method, which in turn would trigger certain notifications for the user.</p>
<h2>Web browser support</h2>
<p>This feature is currently available in <a href="http://www.mozilla.org/firefox/beta/">Firefox beta</a>, but it&#8217;s due to land in the official release of Firefox, version 10, tomorrow! It has also been available in Google Chrome since version 15 and Safari since 5.1.</p>
<h2>Play with fullscreen!</h2>
<p>I have a <a href="http://robnyman.github.com/fullscreen/">Fullscreen API demo</a> available for you to play with, and all the code is available in the <a href="https://github.com/robnyman/robnyman.github.com/tree/master/fullscreen">Fullscreen repository on GitHub</a>.</p>
<p><a href="http://robnyman.github.com/fullscreen/"><img src="http://hacks.mozilla.org/wp-content/uploads/2012/01/fullscreen-api-demo.png" alt=""></a></p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2012/01/using-the-fullscreen-api-in-web-browsers/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Hidden Gems of HTML5: classList</title>
		<link>http://hacks.mozilla.org/2012/01/hidden-gems-of-html5-classlist/</link>
		<comments>http://hacks.mozilla.org/2012/01/hidden-gems-of-html5-classlist/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 11:52:07 +0000</pubDate>
		<dc:creator>Chris Heilmann</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Web Developers]]></category>
		<category><![CDATA[classes]]></category>
		<category><![CDATA[classlist]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[trick]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=11013</guid>
		<description><![CDATA[If you are a web developer, you surely must know how handy it is to dynamically change the class attribute on an element. The benefits this technique are quite a few: You leave any changes in the look and feel to the CSS You avoid having to loop lots of elements as you can allow [...]]]></description>
			<content:encoded><![CDATA[<p>If you are a web developer, you surely must know how handy it is to dynamically change the class attribute on an element. The benefits this technique are quite a few: </p>
<ul>
<li>You leave any changes in the look and feel to the CSS</li>
<li>You avoid having to loop lots of elements as you can allow CSS to do that job for you by assigning a class on a parent element</li>
<li>You can trigger CSS transitions and avoid having to write your own animation</li>
<li>And many more&hellip;</li>
</ul>
<p>The issue with classes is that it is not too simple to work with because of their representation in the DOM. When you read out <code>className</code> you get one string and you need to split it and use regex to find if a class was used and all kind of other annoyances. This is also why it is a very common interview questions for web developers to write a function to deal with classes.</p>
<p>Well, you might not be aware of it, but HTML has a very cool new way to deal with classes called <a href="https://developer.mozilla.org/en/DOM/element.classList">classList</a>. This makes it dead easy to add, remove, toggle and check for classes on an element &#8211; natively in your browser. You can play with it at <a href="http://jsfiddle.net/codepo8/xk6zh/">JSFiddle</a>:</p>
<p><iframe style="width: 100%; height: 400px" src="http://jsfiddle.net/codepo8/xk6zh/embedded/result,css,html" allowfullscreen="allowfullscreen" frameborder="0"></iframe></p>
<p>The methods you have are all you really need:</p>
<ul>
<li><code>element.classList.add('foo')</code> adds the class <code>foo</code> to the element (if it already exists it does nothing)</li>
<li><code>element.classList.remove('foo')</code> removes the class <code>foo</code> from the element</li>
<li><code>element.classList.toggle('foo')</code> alternatively adds and removes the class <code>foo</code> from the element</li>
<li><code>element.classList.contains('foo')</code> returns if the class is applied to the element or not</li>
<li><code>element.classList.toString()</code> returns all the classes as a string (same as reading out <code>className</code>)</li>
</ul>
<p>The <a href="http://caniuse.com/#search=classList">browser support is very good</a> with IE being the party pooper. However, there is a <a href="https://github.com/eligrey/classList.js">polyfill by Eli Grey available</a> for you to use.</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2012/01/hidden-gems-of-html5-classlist/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Using the Vibration API &#8211; Part of WebAPI</title>
		<link>http://hacks.mozilla.org/2012/01/using-the-vibrator-api-part-of-webapi/</link>
		<comments>http://hacks.mozilla.org/2012/01/using-the-vibrator-api-part-of-webapi/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 14:12:56 +0000</pubDate>
		<dc:creator>Robert Nyman</dc:creator>
				<category><![CDATA[WebAPI]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=10956</guid>
		<description><![CDATA[As part of Mozillas WebAPI effort, we have been working with bringing a Vibration API to all devices that support it. The idea with the Vibration API is to be able to give the user a notification, in a game or other use case, by telling the device to vibrate. It accesses the native vibrator [...]]]></description>
			<content:encoded><![CDATA[<p>As part of <a href="https://wiki.mozilla.org/WebAPI">Mozillas WebAPI</a> effort, we have been working with bringing a Vibration API to all devices that support it.</p>
<p><span id="more-10956"></span></p>
<p>The idea with the Vibration API is to be able to give the user a notification, in a game or other use case, by telling the device to vibrate. It accesses the native vibrator and tells it how long it should vibrate.</p>
<h2>Examples</h2>
<p>The way to do this is quite simple &#8211; in this example the parameter is how long it should vibrate, i.e. the number of milliseconds:</p>
<p><code>navigator.mozVibrate(1000);</code></p>
<p>Another way of controlling vibration is giving a vibration pattern, switching between vibrating and being still. The odd parameters in the list is vibration time, the even ones are pauses:</p>
<p><code>navigator.mozVibrate([200, 100, 200, 100]);</code></p>
<p>And if you want to stop the vibration, you can simply call the <code>mozVibrate</code> method with an argument of 0 or an empty pattern, like this:</p>
<p><code> navigator.mozVibrate(0);<br />
navigator.mozVibrate([]);</code></p>
<h2>Try it out!</h2>
<p>If you want to try this out right now, you can do so in <a href="http://www.mozilla.org/firefox/channel/">Firefox Aurora</a>, which is planned to become Firefox 11. Currently, it naturally only works on devices that support vibration, which means Firefox on (most) Android phones. </p>
<p>Note: a possbile caveat could be if you have haptic feedback turned on on your Android device, which then might cancel out the vibration.</p>
<h2>Demo</h2>
<p>I put together a little demo where you can see the code needed and test it in place. Please play around with this and let us know what you think!</p>
<p><iframe style="width: 100%; height: 370px" src="http://jsfiddle.net/robnyman/BrFvC/embedded/js,html,result" allowfullscreen="allowfullscreen" frameborder="0"></iframe></p>
<p><strong>Edit:</strong> Our temporary implementation name was Vibrator API, but since it gave the wrong impression, we now call it Vibration API &#8211; which is also more in line with the <a href="http://www.w3.org/TR/vibration/">W3C Vibration API draft</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2012/01/using-the-vibrator-api-part-of-webapi/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>Wiki Wednesday: January 25, 2012</title>
		<link>http://hacks.mozilla.org/2012/01/wiki-wednesday-january-25-2012/</link>
		<comments>http://hacks.mozilla.org/2012/01/wiki-wednesday-january-25-2012/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 00:42:42 +0000</pubDate>
		<dc:creator>Eric Shepherd</dc:creator>
				<category><![CDATA[Docs]]></category>
		<category><![CDATA[Wiki Wednesday]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=10954</guid>
		<description><![CDATA[Here are today&#8217;s Wiki Wednesday articles! If you know about these topics, please try to find a few minutes to look over these articles that are marked as needing technical intervention and see if you can fix them up. You can do so either by logging into the wiki and editing the articles directly, or [...]]]></description>
			<content:encoded><![CDATA[<p>Here are today&#8217;s <a title="http://hacks.mozilla.org/2011/02/introducing-wiki-wednesdays/" href="http://hacks.mozilla.org/2011/02/introducing-wiki-wednesdays/" rel="external" target="_blank">Wiki Wednesday</a> articles! If you know about these topics, please try to find a few minutes to look over these articles that are marked as needing technical intervention and see if you can fix them up. You can do so either by logging into the wiki and editing the articles directly, or by emailing your notes, sample code, or feedback to <a title="mailto:mdnwiki@mozilla.org" href="mailto:mdnwiki@mozilla.org" rel="external" target="_blank">mdnwiki@mozilla.org</a>.</p>
<p>Contributors to Wiki Wednesday will get recognition in the next Wiki Wednesday announcement. Thanks in advance for your help!</p>
<p><strong>JavaScript</strong></p>
<p><strong></strong>Thanks to David Bruant, -TNO-, and xkizer for their contributions the last couple of weeks.</p>
<ul>
<li><a href="https://developer.mozilla.org/en/JavaScript/Guide/Details_of_the_Object_Model" rel="custom">Details of the object model</a></li>
<li><a href="https://developer.mozilla.org/en/JavaScript_typed_arrays" rel="custom">JavaScript typed arrays</a></li>
<li><a href="https://developer.mozilla.org/en/JavaScript/Getting_Started" rel="custom">Getting Started</a></li>
</ul>
<p><strong>SpiderMonkey</strong></p>
<ul>
<li><a href="https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JS_ExecuteRegExp" rel="custom">JS_ExecuteRegExp</a></li>
<li><a href="https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JS_GetGCParameterForThread" rel="custom">JS_GetGCParameterForThread</a></li>
<li><a href="https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JS_CompileUCFunctionForPrincipalsVersion" rel="custom">JS_CompileUCFunctionForPrincipalsVersion</a></li>
</ul>
<p><strong>Developing Mozilla</strong></p>
<ul>
<li><a href="https://developer.mozilla.org/en/Preferences/Using_preferences_from_application_code" rel="custom">Using preferences from application code</a></li>
<li><a href="https://developer.mozilla.org/en/Components.utils.makeObjectPropsNormal" rel="custom">Components.utils.makeObjectPropsNormal</a></li>
<li><a href="https://developer.mozilla.org/en/Mozilla_DOM_Hacking_Guide" rel="custom">Mozilla DOM Hacking Guide</a></li>
</ul>
<p><strong>Extensions</strong></p>
<ul>
<li><a href="https://developer.mozilla.org/en/Code_snippets/Windows" rel="custom">Windows</a></li>
<li><a href="https://developer.mozilla.org/en/Creating_a_Mozilla_Extension/Adding_the_structure" rel="custom">Adding the structure</a></li>
<li><a href="https://developer.mozilla.org/en/Firefox/Updating_extensions_for_Firefox_7" rel="custom">Updating extensions for Firefox 7</a></li>
</ul>
<p><strong>XUL</strong></p>
<ul>
<li><a href="https://developer.mozilla.org/en/XUL/Attribute/panel.type" rel="custom">panel.type</a></li>
<li><a href="https://developer.mozilla.org/en/XUL_Overlays" rel="custom">XUL Overlays</a></li>
<li><a href="https://developer.mozilla.org/en/Using_the_Editor_from_XUL" rel="custom">Using the Editor from XUL</a></li>
</ul>
<p><strong>XPCOM</strong></p>
<p>Thanks to Neil Rashbrook for his contributions!</p>
<ul>
<li><a href="https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsICRLManager" rel="custom">nsICRLManager</a></li>
<li><a href="https://developer.mozilla.org/en/Using_XPCOM_in_JavaScript_without_leaking" rel="custom">Using XPCOM in JavaScript without leaking</a></li>
<li><a href="https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIDocumentLoader" rel="custom">nsIDocumentLoader</a></li>
</ul>
<p><strong>Interfaces</strong></p>
<ul>
<li><a href="https://developer.mozilla.org/en/XPCOM_Interface_Reference/IAccessibleRelation" rel="custom">IAccessibleRelation</a></li>
<li><a href="https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIMsgWindow" rel="custom">nsIMsgWindow</a></li>
<li><a href="https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIChromeRegistry" rel="custom">nsIChromeRegistry</a></li>
</ul>
<p><strong>Plugins</strong></p>
<ul>
<li><a href="https://developer.mozilla.org/en/Plugins/Out_of_process_plugins" rel="custom">Out of process plugins</a></li>
<li><a href="https://developer.mozilla.org/en/NPAnyCallbackStruct" rel="custom">NPAnyCallbackStruct</a></li>
<li><a href="https://developer.mozilla.org/en/NPN_ReloadPlugins" rel="custom">NPN_ReloadPlugins</a></li>
</ul>
<p><strong>CSS</strong></p>
<p>Thanks to McGurk and cgack for their contributions to CSS documentation!</p>
<ul>
<li><a href="https://developer.mozilla.org/en/CSS/unicode-bidi" rel="custom">unicode-bidi</a></li>
<li><a href="https://developer.mozilla.org/en/CSS/background-repeat" rel="custom">background-repeat</a></li>
<li><a href="https://developer.mozilla.org/en/CSS/-moz-user-modify" rel="custom">-moz-user-modify</a></li>
</ul>
<p><strong>SVG</strong></p>
<ul>
<li><a href="https://developer.mozilla.org/en/SVG/Attribute/dur" rel="custom">dur</a></li>
<li><a href="https://developer.mozilla.org/en/DOM/SVGPatternElement" rel="custom">SVGPatternElement</a></li>
<li><a href="https://developer.mozilla.org/en/DOM/SVGPolylineElement" rel="custom">SVGPolylineElement</a></li>
</ul>
<p><strong>HTML</strong></p>
<p>Thanks to Jens.B and tw2113 for their contributions since last time.</p>
<ul>
<li><a href="https://developer.mozilla.org/en/Web_development/Historical_artifacts_to_avoid" rel="custom">Historical artifacts to avoid</a></li>
<li><a href="https://developer.mozilla.org/en/HTML/Element/meter" rel="custom">meter</a></li>
<li><a href="https://developer.mozilla.org/en/HTML/Element/bdo" rel="custom">bdo</a></li>
</ul>
<p><strong>DOM</strong></p>
<p>Thanks to cgack for contributing!</p>
<ul>
<li><a href="https://developer.mozilla.org/en/DOM/document.mozFullScreenEnabled" rel="custom">document.mozFullScreenEnabled</a></li>
<li><a href="https://developer.mozilla.org/en/Document_Object_Model_%28DOM%29/Event/CustomEvent" rel="custom">CustomEvent</a></li>
<li><a href="https://developer.mozilla.org/en/DOM/Selection" rel="custom">Selection</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2012/01/wiki-wednesday-january-25-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mozilla Vision 2012 day two &#8211; here come the web makers of tomorrow</title>
		<link>http://hacks.mozilla.org/2012/01/mozilla-vision-2012-day-two-here-come-the-web-makers-of-tomorrow/</link>
		<comments>http://hacks.mozilla.org/2012/01/mozilla-vision-2012-day-two-here-come-the-web-makers-of-tomorrow/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 08:42:38 +0000</pubDate>
		<dc:creator>Chris Heilmann</dc:creator>
				<category><![CDATA[Event]]></category>
		<category><![CDATA[2012]]></category>
		<category><![CDATA[japan]]></category>
		<category><![CDATA[mozvision]]></category>
		<category><![CDATA[tokyo]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=10946</guid>
		<description><![CDATA[One day after the conference part of Mozilla Vision 2012 volunteers, Mozilla staff and friends organised a &#8220;hackday&#8221; event in a burger cafe (of all places) in Tokyo. The twist: instead of catering to developer hackers the audience was web makers &#8211; and in this case those of the future: Yes, we mostly had kids [...]]]></description>
			<content:encoded><![CDATA[<p>One day after the conference part of <a href="http://mozilla.jp/events/vision/2012/">Mozilla Vision 2012</a> volunteers, Mozilla staff and friends organised a &#8220;hackday&#8221; event in a burger cafe (of all places) in Tokyo. The twist: instead of catering to developer hackers <a href="https://wiki.mozilla.org/Japan/Events/MozillaVision2012/Workshop">the audience was web makers</a> &#8211; and in this case those of the future:</p>
<p><a href="http://www.flickr.com/photos/codepo8/6740546021/" title="Look Foxkeh, I did something with the web! by codepo8, on Flickr"><img src="http://farm8.staticflickr.com/7162/6740546021_682036e244.jpg" width="500" height="375" alt="Look Foxkeh, I did something with the web!"></a></p>
<p>Yes, we mostly had kids getting excited about what can be done with the web and its technologies and for this veteran of many a hack day this was an amazing experience. </p>
<p>The whole day was run as a series of &#8220;Popups&#8221; as defined by the <a href="http://explorecreateshare.org/2011/12/15/fireside-chat-starting-a-learning-network-in-your-city/">Hive learning network, NYC</a>. As explained in <a href="http://commonspace.wordpress.com/2012/01/24/every-event-is-a-laboratory/">Mark Surman&#8217;s blog post</a> the activities provided were:</p>
<ul>
<li>Using <a href="http://hackasaurus.org/en-US/">Hackasaurus</a> to remix the web</li>
<li>Creating simple programs with <a href="http://scratch.mit.edu/">MIT&#8217;s Scratch</a></li>
<li>Using the Paper-protyping-for-interface-design Firefox add on Domova (build by Keio University and Mozilla Japan)</li>
<li>Print out a stencil and use colours to make your mark on a wall with Paint <sup>n</sup></li>
<li>Building your own platform game using the Canvas/HTML5 based <a href="https://github.com/jonoxia/platform-game">Run Jump Build</a></li>
<li>Creating your own animation using Mozilla Japan&#8217;s Para Para</li>
</ul>
<p>All of which were a big success with the kids. I especially liked the idea of Para Para, which is why I quickly interviewed Brian Birtles of Mozilla Japan about it:</p>
<p><video controls width="100%" controls preload="none" poster="http://cf.cdn.vid.ly/7n1q8b/poster.jpg"><source src="http://cf.cdn.vid.ly/7n1q8b/mp4.mp4" type="video/mp4"><source src="http://cf.cdn.vid.ly/7n1q8b/webm.webm" type="video/webm"><source src="http://cf.cdn.vid.ly/7n1q8b/ogv.ogv" type="video/ogg"><a target="_blank" href="http://vid.ly/7n1q8b"><img src="http://cf.cdn.vid.ly/7n1q8b/poster.jpg" width="500"></a></video> </p>
<p>All in all the second day of the event was a surprise and it showed me that there is a lot of great things to come in the next generation of web makers.</p>
<p><a href="http://www.flickr.com/photos/codepo8/6740519065/" title="IMG_20120122_024030 by codepo8, on Flickr"><img src="http://farm8.staticflickr.com/7171/6740519065_1135e1b397.jpg" width="500" height="375" alt="IMG_20120122_024030"></a></p>
<p>It was very refreshing to see that with some guidance and a share of enthusiasm kids happily create and use the web as a read/write medium instead of just playing games and watching movies. It is up to us to make the web of tomorrow not TV on steroids.</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2012/01/mozilla-vision-2012-day-two-here-come-the-web-makers-of-tomorrow/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://cf.cdn.vid.ly/7n1q8b/mp4.mp4" length="8415546" type="video/mp4" />
<enclosure url="http://cf.cdn.vid.ly/7n1q8b/webm.webm" length="9586046" type="video/webm" />
<enclosure url="http://cf.cdn.vid.ly/7n1q8b/ogv.ogv" length="20264472" type="video/ogg" />
		</item>
		<item>
		<title>Starting 2012 with loads of doc updates</title>
		<link>http://hacks.mozilla.org/2012/01/starting-2012-with-loads-of-doc-updates/</link>
		<comments>http://hacks.mozilla.org/2012/01/starting-2012-with-loads-of-doc-updates/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 03:50:50 +0000</pubDate>
		<dc:creator>Janet Swisher</dc:creator>
				<category><![CDATA[Docs]]></category>
		<category><![CDATA[Sprints]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=10823</guid>
		<description><![CDATA[We&#8217;re aware of the problem on MDN in which error messages appear in place of code examples (and a few other places). This is due to a bug in the wiki platform software that causes some of its extensions to fail to load when a server restarts. The problem has been diagnosed by the vendor, [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>
We&#8217;re aware of the problem on MDN in which error messages appear in place of code examples (and a few other places). This is due to a bug in the wiki platform software that causes some of its extensions to fail to load when a server restarts. The problem has been diagnosed by the vendor, and we are awaiting a patch to fix it. Sorry for the inconvenience and thanks for your patience!
</p></blockquote>
<p>The year 2012 is off to a great start for the MDN documentation and its community. This past weekend, a bunch of community members gathered virtually for a documentation sprint to write, update, and translate docs. But already in the preceding weeks, a great deal of work had already been accomplished. This post is a recap of those efforts.</p>
<h2>Doc sprint results</h2>
<ul>
<li><strong>Onur Avsar</strong> filled in lots of missing information in <a href="https://developer.mozilla.org/en/HTTP/HTTP_response_codes">HTTP response codes</a>, and improved <a href="https://developer.mozilla.org/en/HTML/Element/time">&lt;time&gt;</a> and <a href="https://developer.mozilla.org/en/HTML/Element/frame">&lt;frame&gt;</a>.
</li>
<li><strong>Michael Beckwith</strong> improved and updated the <a href="https://developer.mozilla.org/en/HTML/HTML5/HTML5_Thematic_Classification">HTML5 &amp; friends thematic classification</a>, <a href="https://developer.mozilla.org/en/Common_CSS_Questions">Common CSS questions</a>, and <a href="https://developer.mozilla.org/en/HTML/Tips_for_authoring_fast-loading_HTML_pages">Tips for authoring fast-loading HTML pages</a>.
</li>
<li><strong>Hans Hillen</strong> created pages for <a href="https://developer.mozilla.org/en/ARIA/ARIA_Guides">ARIA guides</a>, <a href="https://developer.mozilla.org/en/ARIA/ARIA_Techniques">ARIA techniques</a>, <a href="https://developer.mozilla.org/en/ARIA/ARIA_Techniques/ARIA_Technique_Template">ARIA technique template</a> and the specific technique <a href="https://developer.mozilla.org/en/ARIA/ARIA_Techniques/Using_the_alert_role">Using the alert role</a>.
</li>
<li><strong>Jeremie Patonnier</strong> improved <a href="https://developer.mozilla.org/en/SVG/Content_type">SVG Content type</a> and <a href="https://developer.mozilla.org/en/SVG/Attribute/fill-rule">fill-rule</a> and created pages for 7 SVG attributes.
</li>
<li><strong>Rajeev Bharshetty</strong> added code examples for embedding audio in <a href="https://developer.mozilla.org/en/Using_HTML5_audio_and_video">Using HTML5 audio and video</a>, for SVG elements <a href="https://developer.mozilla.org/en/SVG/Element/text">text</a>, <a href="https://developer.mozilla.org/en/SVG/Element/title">title</a>, and <a href="https://developer.mozilla.org/en/SVG/Element/g">g</a> and SVG attributes <a href="https://developer.mozilla.org/en/SVG/Attribute/class">class</a>, <a href="https://developer.mozilla.org/en/SVG/Attribute/script">script</a>, <a href="https://developer.mozilla.org/en/SVG/Attribute/r">r</a>, <a href="https://developer.mozilla.org/en/SVG/Attribute/cy">cy</a>, <a href="https://developer.mozilla.org/en/SVG/Attribute/cx">cx</a>, and <a href="https://developer.mozilla.org/en/SVG/Attribute/points">points</a>.
</li>
<li><strong>Fred Bourgeon</strong> restructured and improved <a href="https://developer.mozilla.org/en/CSS/opacity">CSS opacity</a> and translated a bunch of CSS property pages into French.
</li>
<li><strong>David Bruant</strong> did a major rewrite of <a href="https://developer.mozilla.org/en/JavaScript/Guide/Inheritance_and_the_prototype_chain">Inheritance and the prototype chain</a> in the JavaScript Guide, and wrote an article on <a href="https://developer.mozilla.org/en/Web_Development/HTTP_cookies">HTTP cookies</a>.
</li>
<li><strong>Corey Gackenheimer</strong> added browser compatibility and an example to <a href="https://developer.mozilla.org/en/DOM/DeviceOrientationEvent">DeviceOrientationEvent</a>, and moved some obsolete information from <a href="https://developer.mozilla.org/en/Detecting_device_orientation">Detecting device orentation</a> to <a href="https://developer.mozilla.org/en/DOM/MozOrientation">MozOrientation</a>.
</li>
<li><strong>Trevor Hobson</strong> added the isURIVisited method to <a href="https://developer.mozilla.org/en/XPCOM_Interface_Reference/mozIAsyncHistory">mozIAsyncHistory</a>.
</li>
<li><strong>Burak Yi&#287;it Kaya</strong> cleaned up the pages for the <a  href="https://developer.mozilla.org/en/JavaScript/Reference/Operators/instanceof">instanceof</a> operator, the <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/bind">bind</a> function, <a href="https://developer.mozilla.org/en/DOM/window.setTimeout">window.setTimeout</a>, and <a href="https://developer.mozilla.org/en/DOM/element.addEventListener">element.addEventListener</a>.
</li>
<li><strong>Filipus Klutiero</strong> clarified the difference between <a href="https://developer.mozilla.org/en/DOM/form.submit">form.submit </a> and a form submit button.
</li>
<li><strong>Jeremie Patonnier</strong> created pages for 5 more SVG attributes and<br />
<href="https://developer.mozilla.org/en/DOM/SVGCursorElement">SVGCursorElement</a>, and updated the SVG <a href="https://developer.mozilla.org/en/SVG/Content_type#IR"I>IRI content type</a>.
</li>
<li><strong>Jonathan Protzenko</strong> revamped the <a href="https://developer.mozilla.org/en/Extensions/Thunderbird">Thunderbird extensions</a> page.
</li>
<li><strong>Colby Russell</strong> wrote an article on <a href="https://developer.mozilla.org/en/DOM_Inspector/Internals">DOM Inspector internals</a>.
</li>
<li><strong>Florian Scholz</strong> documented two more MathML elements (<a href="https://developer.mozilla.org/en/MathML/Element/mlabeledtr">mlabeledtr</a> and <a href="https://developer.mozilla.org/en/MathML/Element/mglyph">mglyph</a>, created pages for the <a href="https://developer.mozilla.org/en/DOM/window.navigator.mozBattery">Battery API</a> and <a href="https://developer.mozilla.org/en/CSS/column-fill">CSS column-fill</a> property, documented the <code>muted</code> and <code>loop</code> properties of <a href="https://developer.mozilla.org/en/DOM/HTMLMediaElement">HTMLMediaElement</a>, and added Gecko-specific properties to <a href="https://developer.mozilla.org/en/DOM/HTMLVideoElement">HTMLVideoElement</a>.
</li>
<li><strong>Tom Schuster</strong> started a page for <a href="https://developer.mozilla.org/en/JavaScript/ECMAScript_6_support_in_Mozilla">ECMAScript 6 in Mozilla</a> and added <a href="https://developer.mozilla.org/en/DOM/window.crypto.getRandomValues">window.crypto.getRandomValues</a>.
</li>
<li><strong>Marek St&#281pie&#324;</strong> created pages for <a href="https://developer.mozilla.org/en/DOM/document.head">document.head</a>, <a href="https://developer.mozilla.org/en/DOM/DOM_event_reference/DOMContentLoaded">DOMContentLoaded</a>, and the JavaScript global object <a hreaf="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Set">Set</a>; documented browser variations in the return value of <a href="https://developer.mozilla.org/en/DOM/element.getElementsByTagName">element.getElementsByTagName</a>; updated several <a href="https://developer.mozilla.org/en/DOM/window.navigator">window.navigator</a> properties to match the HTML5 spec and reality; and did a bunch of other clean-ups and updates.
</li>
<li><strong>Andreas Wagner</strong> documented and wrote exmaple code for a <a href="https://developer.mozilla.org/en/Extensions/Thunderbird/Demo_Addon">demo add-on for Thunderbird</a>, and created pages for <a href="https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIMsgAccount">nsIMsgAccount</a> and <a href="https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIMsgIncomingServer">nsIMsgIncomingServer</a>.
</li>
<li><strong>Patrick Wied</strong> created a page for <a href="https://developer.mozilla.org/en/SVG/Attribute/contentStyleType">SVG contentStyleType</a>, added examples to <a href="https://developer.mozilla.org/en/DOM/HTMLSelectElement">HTMLSelectElement</a> and <a href="https://developer.mozilla.org/en/SVG/Attribute/style">SVG style attribute</a>, and fixed up links in several pages for SVG-related DOM interfaces.
</li>
<li><strong>Jonathan Wilsson</strong> added or updated browser compatibility for 3 HTML elements, 2 DOM elements, and <em>42</em> CSS properties and pseudo-classes. He also added content to <a href="https://developer.mozilla.org/En/CSS/:focus">:focus</a> and <a href="https://developer.mozilla.org/En/CSS/:enabled">:enabled</a>.
</li>
</ul>
<h2>Previous activity</h2>
<p>Here are some of the significant changes in the weeks prior to the doc sprint.</p>
<h3>Web standards docs</h3>
<ul>
<li><strong>Eric Bidelman</strong> added mobile browser compatibility info for <a href="https://developer.mozilla.org/En/DOM/Document.querySelectorAll">document.querySelectorAll</a> and <a href="https://developer.mozilla.org/En/DOM/Document.querySelector">document.querySelector</a>.
</li>
<li><strong>Fred Bourgeon</strong> continued what he started during Mercredi Doc by creating French translations for 9 CSS animation-related properties and two SVG attributes.
</li>
<li><strong>Mattias Ekendahl</strong> created a page for <a href="https://developer.mozilla.org/en/DOM/cssMediaRule">cssMediaRule</a>.
</li>
<li><strong>Corey Gackenheimer</strong> added a browser compatibility table to <a href="https://developer.mozilla.org/en/DOM/DeviceOrientationEvent">DeviceOrientationEvent</a>.
</li>
<li><strong>Masayuki</strong> created pages for <a href="https://developer.mozilla.org/en/DOM/DOM_event_reference/input">DOM input event</a> and <a href="https://developer.mozilla.org/en/DOM/UIEvent">UIEvent</a>, and edited a bunch of pages related to DOM events.
</li>
<li><strong>Timoth&eacute;e Carry-Caignon</strong> added some notes to <a href="https://developer.mozilla.org/en/HTML/Element/button">&lt;button&gt;</a> <strong>(update 2012-01-24:)</strong> and translated <a href="https://developer.mozilla.org/en/Web_development/Writing_forward-compatible_websites">Writing forward-compatible websites</a> into <a href="https://developer.mozilla.org/fr/D%C3%A9veloppement_Web/D%C3%A9velopper_des_sites_%C3%A0_compatibilit%C3%A9_descendante">French</a>.
</li>
<li><strong>Nickolay Ponomarev</strong> updated and improved the pages for <a href="https://developer.mozilla.org/en/DOM/document">DOM document</a> and <a href="https://developer.mozilla.org/en/DOM/XMLHttpRequest">XMLHttpRequest</a>.
</li>
<li><strong>Florian Scholz</strong> updated <a href="https://developer.mozilla.org/en/DOM/CanvasRenderingContext2D">CanvasRenderingContext2D</a> and added WebKit- and Gecko-specific methods and attributes.
</li>
<li><strong>Rob W</strong> added an example to <a href="https://developer.mozilla.org/En/DOM/Node.normalize">Node.normalize</a>.
</li>
<li><strong>Toji</strong> added several new resources to the <a href="https://developer.mozilla.org/en/WebGL">WebGL</a> page.
<li><strong>xkizer</strong> improved the examples and explanations in the <a href="https://developer.mozilla.org/en/JavaScript/Guide/Predefined_Core_Objects">Predefined core objects</a> section of the <a href="https://developer.mozilla.org/en/JavaScript/Guide">JavaScript Guide</a>.
</li>
<li><strong>XP1</strong> fixed a bunch of copyediting and style consistency issues in a whole slew of pages.
</li>
</ul>
<h3>Mozilla technology docs</h3>
<ul>
<li><strong>Will Bamberg</strong> created a landing page and various articles for <a href="https://developer.mozilla.org/en/BrowserID">BrowserID</a>.
</li>
<li><strong>Axel Grude</strong> created pages for two dozen messaging-related XPCOM interfaces.
</li>
<li><strong>Benjamin Smedberg</strong> wrote an article on <a href="https://developer.mozilla.org/en/XPCOM/Making_Cross-Thread_Calls_Using_Runnables">Making cross-thread calls using runnables</a> in XPCOM.
</li>
</ul>
<h3>Mozilla project docs</h3>
<ul>
<li><strong>Jeff Beatty</strong>&#8216;s work on the <a href="https://developer.mozilla.org/en/Localization_Quick_Start_Guide">Localization Quick Start Guide</a> is &#8220;done&#8221; &mdash; no longer marked as a draft.
</li>
<li><strong>Mark C&#244;t&eacute;</strong> updated <a href="https://developer.mozilla.org/en/Mozilla_automated_testing">Mozilla automated testing</a> to match current practices.
</li>
<li><strong>Jeff Muizelaar</strong> wrote an article on <a href="https://developer.mozilla.org/en/Debugging_Update_Problems">Debugging update problems</a>.
</li>
<li><strong>Jonathan Watt</strong> updated <a href="https://developer.mozilla.org/en/Debugging_on_Mac_OS_X">Debugging on Mac OS X</a>, added an Installation section to <a href="https://developer.mozilla.org/en/Eclipse">Eclipse</a> , and signficantly updated and rewrote <a href="https://developer.mozilla.org/en/Eclipse_CDT">Eclipse CDT</a> and <a href="https://developer.mozilla.org/En/Developer_Guide/Using_NetBeans_with_Mozilla">Using NetBeans with Mozilla</a>.
</li>
<li><strong>Jared Wein</strong> wrote articles on <a href="https://developer.mozilla.org/en/Hacking_Firefox/Getting_started_with_contributing_patches_to_the_Firefox_preferences">Getting started with contributing patches to the Firefox preferences<a/> and <a href="https://developer.mozilla.org/En/Developer_Guide/Requesting_feedback_and_ui-review_for_desktop_Firefox_front-end_changes">Requesting feedback and ui-review for desktop Firefox front-end changes<a/>.
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2012/01/starting-2012-with-loads-of-doc-updates/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>JavaScript on the server: Growing the Node.js Community</title>
		<link>http://hacks.mozilla.org/2012/01/javascript-on-the-server-growing-the-node-js-community/</link>
		<comments>http://hacks.mozilla.org/2012/01/javascript-on-the-server-growing-the-node-js-community/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 21:10:23 +0000</pubDate>
		<dc:creator>Robert Nyman</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=10857</guid>
		<description><![CDATA[Cloud9 IDE and Mozilla have been working together ever since their Bespin and ACE projects joined forces. Both organizations are committed to the success of Node.js, Mozilla due to its history with Javascript and Cloud9 IDE as a core contributor to Node.js and provider of the leading Node.js IDE. As part of this cooperation, this [...]]]></description>
			<content:encoded><![CDATA[<p><i><a href="http://c9.io/">Cloud9 IDE</a> and Mozilla have been working together ever since their <a href="http://mozillalabs.com/skywriter/2011/01/18/mozilla-skywriter-has-been-merged-into-ace/">Bespin and ACE</a> projects joined forces. Both organizations are committed to the success of Node.js, Mozilla due to its history with Javascript and Cloud9 IDE as a core contributor to Node.js and provider of the leading Node.js IDE. As part of this cooperation, this is a guest post written by Ruben Daniels and Zef Hemel of Cloud9 IDE.</i></p>
<p>While we all know and love JavaScript as a language for browser-based scripting, few remember that, early on, it was destined to be used as a server-side language as well. Only about a year after JavaScript’s original release in Netscape Navigator 2.0 (1995), <a href="http://www.thefreelibrary.com/NETSCAPE+INTRODUCES+NETSCAPE+ENTERPRISE+SERVER(TM)+2.0-a018056425">Netscape released Netscape Enterprise Server 2.0</a>:</p>
<blockquote><p>Netscape Enterprise Server is the first web server to support the Java(TM) and JavaScript(TM) programming languages, enabling the creation, delivery and management of live online applications.</p></blockquote>
<p>This is how the web got started, all the way back in the mid-nineties. Sadly, it was not meant to be then. JavaScript on the server failed, while JavaScript in the browser became a hit. At the time, JavaScript was still very young. The virtual machines that executed JavaScript code were slow and heavy weight, and there were no tools to support and manage large JavaScript code bases. This was fine for JavaScript’s use case in the browser at the time, but not sufficient for server-side applications.</p>
<p><span id="more-10857"></span></p>
<p>Still, there are two obvious advantages that support this idea of using JavaScript not only in the browser, but on the server as well:</p>
<ol>
<li>Skill reuse. Developers only have to learn a single programming language that they can use for both client and server-side programming. Front-end developers can leverage their existing skills to build server applications too.</li>
<li>Code reuse. The opportunity to write your code once and be able to run it on either client or server, opens up great opportunities. The most obvious example would be reusing code to validate forms, which you have to do on both sides anyway. But there are many more exciting opportunities to be explored, e.g. the ability to <a href="http://ajaxian.com/archives/server-side-rendering-with-yui-on-node-js">dynamically decide where to render your UI</a> (client or server, or a mix) based on device capabilities.</li>
</ol>
<p>Over the past decade and a half, many projects have tried to reintroduce JavaScript on the server, but again and again there was very little uptake. </p>
<h2>A New Hope</h2>
<p>Then, <a href="http://nodejs.org">Node.js</a> happened. Node.js is the first implementation of JavaScript that people get genuinely excited about. Why is that? What makes Node.js different from previous attempts?</p>
<p>As it turns out, previous attempts dismissed one core, powerful and often overlooked feature of JavaScript: its single-threaded nature. JavaScript is single threaded in the browser. Nevertheless, previous server-side JavaScript implementations did have regular threading the way every server-side language does, like Java, Python or Ruby, for instance.</p>
<p>Node.js deliberately took a different path, the path more in line with browser JavaScript: Node.js is single threaded, and event based.</p>
<p>This has two advantages: it avoids concurrency issues and it supports the construction of super efficient high-performance servers.  </p>
<p>Programming with threads is hard. Very hard. When things happen at the same time concurrency bugs can occur easily (e.g. two threads modifying the same piece of memory simultaneously), which are incredibly difficult to reproduce and fix. Courses are taught at universities to teach students how to avoid concurrency problems using locks, semaphores etc. Concurrency is difficult, it’s best to avoid it when possible &#8212; Node.js enables you to avoid concurrency by not supporting it at all, at least on a process level. In a Node.js process, only one thing happens at a time.</p>
<p>Servers built with Node.js are typically super fast and can handle thousands, tens of thousands, even hundreds of thousands of concurrent connections &#8212; something very difficult to achieve with threaded servers. How can that be?</p>
<p>It’s all based on the observation that server threads in typical web application servers spend most of their time doing nothing &#8212; just idly waiting for the result of a database query, waiting for the disk to spin and return a file that’s requested or waiting for data to come over the network. For every single connected client there’s a thread just sitting there, idly, using up resources.</p>
<p>Node.js servers work differently. Node.js uses asynchronous APIs for operations that require I/O such as fetching a file or sending a database query. This is exactly the same way AJAX calls work in the browser, as well as other recent asynchronous HTML5 JavaScript APIs such as various database APIs (IndexedDB and WebSQL) and Geolocation. All these APIs don’t want to block the browser thread, because it may take half a second or even multiple seconds to retrieve the results, which would freeze up the browser. Instead, they simply trigger the call and pass a callback function to be invoked when the results come in. In the mean time, the browser thread can keep rendering the page and do other things. This is <em>exactly</em> how any I/O API works in Node.js.</p>
<h2>The Node.js Community</h2>
<p>The Node.js community has been growing rapidly over the past years. More and more companies build their servers with Node.js, especially for servers that require real-time communication and therefore have to handle a lot of simultaneous connections. As the real-time web grows, so will the use of Node.js.</p>
<p>Therefore, it is time to make Node.js more accessible to the developer community. To do this, Node.js needs a few things:</p>
<ol>
<li>Tooling</li>
<li>Good documentation</li>
<li>A community website with in-depth articles and tutorials</li>
<li>Training</li>
</ol>
<p>At <a href="http://c9.io">Cloud9 IDE</a> we have set ourself the goal to build the best possible IDE for Node.js development. After all, Cloud9 IDE itself is a prime example of what we envision as the future of web development: Cloud9 IDE uses JavaScript front to back, using browser Javascript on the client and Node.js on the server.</p>
<p>Using Cloud9 IDE you can try out and play with Node.js without having to install anything. You can create Node.js projects, run, debug and deploy your project right from the IDE.</p>
<p>In collaboration with partners in the Node.js community, we are now launching three more initiatives:</p>
<ol>
<li><a href="http://nodebits.org">Nodebits.org</a> is the new community website for Node.js developers with the latest news, in-depth articles and tutorials.</li>
<li><a href="http://nodemanual.org">NodeManual.org</a> is the new one-stop source of Node.js documentation. The MDN of Node.js development, if you will.</li>
<li><a href="http://training.c9.io">Training</a> provides three-day Node.js training courses for the enterprise.</li>
</ol>
<p>Any example code used on Nodebits, NodeManual and our training material can be run in Cloud9 IDE with just a click of a button, lowering the barrier to try out the examples even more.</p>
<p>With these initiatives we aim to turn Node.js into the mainstream web development platform of the future: JavaScript front to back. It only makes sense.</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2012/01/javascript-on-the-server-growing-the-node-js-community/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Firefox goes 2-digit, time to check your UA sniffing scripts</title>
		<link>http://hacks.mozilla.org/2012/01/firefox-goes-2-digit-time-to-check-your-ua-sniffing-scripts/</link>
		<comments>http://hacks.mozilla.org/2012/01/firefox-goes-2-digit-time-to-check-your-ua-sniffing-scripts/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 08:34:16 +0000</pubDate>
		<dc:creator>Jean-Yves Perrier</dc:creator>
				<category><![CDATA[Featured Article]]></category>
		<category><![CDATA[Firefox 10]]></category>
		<category><![CDATA[maintainability]]></category>
		<category><![CDATA[web technologies]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=10782</guid>
		<description><![CDATA[We all know it: UA-based browser detection is bad, the right way is feature-detection. Regardless, legacy code relies upon UA sniffing and may need to be updated for Firefox 10&#8242;s release. Even if it looks simple, UA parsing has proven to be a headache for numerous script authors. Though the structure of an UA is [...]]]></description>
			<content:encoded><![CDATA[<p>We all know it: <a href="http://en.wikipedia.org/wiki/User_agent_string#User_agent_sniffing" target="_blank">UA-based browser detection</a> is bad, <a title="How to write forward-compatible websites" href="https://developer.mozilla.org/en/Web_development/Writing_forward-compatible_websites" target="_blank">the right way is feature-detection</a>. Regardless, legacy code relies upon UA sniffing and may need to be updated for Firefox 10&#8242;s release.</p>
<p>Even if it looks simple, UA parsing has proven to be a headache for numerous script authors. Though the <a title="Structure of UserAgent: in the HTTP RFC2616 specification" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43" target="_blank">structure of an UA is defined in the HTTP specification</a>, the way relevant information is conveyed varies from one vendor to another. Also, the information you want to extract from it is not always the same: sometimes you want to know the browser (Firefox, SeaMonkey, Safari, Chrome, IE, Opera…), but most of the time you want to know the engine that powers them (Gecko, Webkit, Trident,…). You also need to get the version of the browser or the engine.</p>
<p>Old scripts often made some undue assumptions. Some are assuming that browser version numbers will never reach 10&#8230; This is not the case: Opera and Chrome have already crossed this landmark long ago, Firefox will reach it next week and <a title="UA String for IE10" href="http://blogs.msdn.com/b/ie/archive/2011/04/15/the-ie10-user-agent-string.aspx" target="_blank">IE soon after</a>.</p>
<p>A few examples of Firefox UAs that your scripts should allow:</p>
<ul>
<li>Regular Firefox version: <em>Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0) Gecko/20100101 Firefox/10.0</em></li>
<li>Nightly and Aurora Firefox versions:<em> Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:12.0a1) Gecko/20120122 Firefox/12.0a1</em></li>
<li>Chemspill Firefox version (three numbers) <em>Mozilla/5.0 (Windows NT 6.2; rv:10.0.1) Gecko/20100101 Firefox/10.0.1</em></li>
</ul>
<p><em>So, it is the last moment to check your UA-based browser detection code before your site goes havoc!</em></p>
<h3>Last chance to check</h3>
<p><em>Do it right now, in two weeks it would be too late.</em></p>
<p>What to do?</p>
<ol>
<li>Code inspection: check your code to see if there is some UA-based browser detection code. If so, check if it handles multi-digit versions. (At the same time you could check if it is useful at all. Some old UA-detection code has not worked in ages, or try to go around problems fixed since years in browser&#8230;)</li>
<li>Library inspection: lots of libraries perform UA-based browser detection. If you are using any of them, check if it still is working with a version of Firefox with 2 digits. If not, notify the author of the lib and <a title="Fill a bug in the Tech Evangelism component" href="https://bugzilla.mozilla.org/enter_bug.cgi?product=Tech%20Evangelism" target="_blank">open a bug on bugzilla</a> so that we can help others as all their customers are likely to suffer from the same problem.</li>
<li><strong>Check if your site is working with the next Firefox version</strong>: download the <a title="Downloading Aurora or Beta releases of Firefox" href="http://www.mozilla.org/firefox/channel/" target="_blank">Beta release of Firefox 10</a> (you can run <a title="How to run multiple firefox versions" href="http://robertnyman.com/2009/07/01/firefox-35-is-released-information-about-having-multiple-firefox-versions-and-web-developer-extension-compatibility/" target="_blank">several versions</a> of Firefox <a title="How to run multiple firefox versions" href="http://forums.mozillazine.org/viewtopic.php?f=23&amp;t=2249039" target="_blank">simultaneously</a>) It is always a good idea to use the beta, or even the aurora, version of Firefox if you are maintaining a site: you&#8217;ll discover incompatibilities earlier and will get time to fix them before your users start complaining. We are doing our best to prevent problems, but sometimes old code rely on incorrect behavior and stop working even when we are only fixing bugs.</li>
<li style="text-align: left;">Test other sites :-). Use the beta or aurora version of Firefox and surf the web. When you hit a UA-related problem <a title="Fill a bug in the Tech Evangelism component" href="https://bugzilla.mozilla.org/enter_bug.cgi?product=Tech%20Evangelism" target="_blank">report it with bugzilla</a>. Give us as much info as possible like the importance of the site in your country and if you have conducted any action yourself. That way our evangelism team will be able to prioritize work adequately.</li>
</ol>
<p>Finally, you should plan to get rid of these UA-based browser detection mechanism. If you can&#8217;t — and I know it isn&#8217;t always possible — I would be glad to know why: so please let us know in the comments below.</p>
<p>Now it is time to check your sites :-)</p>
<p>Thank you very much for your help.</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2012/01/firefox-goes-2-digit-time-to-check-your-ua-sniffing-scripts/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
	</channel>
</rss>

