<?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>Mark Finkle's Weblog &#187; Extensions</title>
	<atom:link href="http://starkravingfinkle.org/blog/tags/extensions/feed/" rel="self" type="application/rss+xml" />
	<link>http://starkravingfinkle.org/blog</link>
	<description></description>
	<lastBuildDate>Wed, 28 Jul 2010 14:19:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Updating Add-ons in Firefox Mobile 1.1</title>
		<link>http://starkravingfinkle.org/blog/2010/05/updating-add-ons-in-firefox-mobile-1-1/</link>
		<comments>http://starkravingfinkle.org/blog/2010/05/updating-add-ons-in-firefox-mobile-1-1/#comments</comments>
		<pubDate>Fri, 28 May 2010 20:09:51 +0000</pubDate>
		<dc:creator>Mark Finkle</dc:creator>
				<category><![CDATA[Extensions]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mozilla]]></category>

		<guid isPermaLink="false">http://starkravingfinkle.org/blog/?p=763</guid>
		<description><![CDATA[In previous versions of Firefox Mobile, you could check for and install updates for your add-ons by pressing the &#8220;Update&#8221; button in the Add-ons Manager.  This meant that you could check whenever and as often as you wanted, but, if you didn&#8217;t really want to manage these things manually, you could find yourself without [...]]]></description>
			<content:encoded><![CDATA[<p>In previous versions of <a href="http://www.mozilla.com/mobile/">Firefox Mobile</a>, you could check for and install updates for your add-ons by pressing the &#8220;Update&#8221; button in the Add-ons Manager.  This meant that you could check whenever and as often as you wanted, but, if you didn&#8217;t really want to manage these things manually, you could find yourself without the latest versions.</p>
<p><img src="http://starkravingfinkle.org/blog/wp-content/uploads/2010/05/fennec-addons-update-button-300x96.png" alt="" title="fennec-addons-update-button" width="300" height="96" class="alignnone size-medium wp-image-764" /></p>
<p>Desktop versions of Firefox will prompt you that a new version of an add-on is available. Maybe this prompt is enough for you to actually update the add-on, maybe it isn&#8217;t. Maybe you find the whole process annoying and/or boring.</p>
<p>In Firefox Mobile 1.1, we introduce automatic add-on upgrades. Once a day, Firefox will check your add-ons for an update and if an update is found, we download and install the new version. If you&#8217;re interested, you can go to the Add-ons Manager and see what add-ons have been updated. If you&#8217;re eager to use the new add-on, you can restart. In the future, some add-ons may not even need a restart.</p>
<p><img src="http://starkravingfinkle.org/blog/wp-content/uploads/2010/05/fennec-addons-update-auto-300x187.png" alt="" title="fennec-addons-update-auto" width="300" height="187" class="alignnone size-medium wp-image-765" /></p>
<p>Of course, you can still use the &#8220;Update&#8221; button to force add-ons to update right away, without waiting for the next automatic check.</p>
<p>If you want to turn off automatic add-on updates, you can use <code>about:config</code> and set <code>extensions.autoupdate.enabled</code> to <code>false</code>. If you&#8217;d like to change the timing for automatic updates, set <code>extensions.autoupdate.interval</code> to a different number of seconds.</p>
]]></content:encoded>
			<wfw:commentRss>http://starkravingfinkle.org/blog/2010/05/updating-add-ons-in-firefox-mobile-1-1/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Firefox Mobile 1.1 Beta 1 and Add-ons</title>
		<link>http://starkravingfinkle.org/blog/2010/04/firefox-mobile-1-1-beta-1-and-add-ons/</link>
		<comments>http://starkravingfinkle.org/blog/2010/04/firefox-mobile-1-1-beta-1-and-add-ons/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 19:51:29 +0000</pubDate>
		<dc:creator>Mark Finkle</dc:creator>
				<category><![CDATA[Extensions]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mozilla]]></category>

		<guid isPermaLink="false">http://starkravingfinkle.org/blog/?p=707</guid>
		<description><![CDATA[With Firefox 1.1 Beta 1 for Maemo ready to go and the final release not far away, now is an excellent time for add-on developers to update their add-ons. Obviously, Mozilla wants as many add-ons as possible to be compatible with the latest version of Firefox Mobile.
AMO (addons.mozilla.org) is ready for add-ons to set maxVersion [...]]]></description>
			<content:encoded><![CDATA[<p>With Firefox 1.1 Beta 1 for Maemo ready to go and the final release not far away, now is an excellent time for add-on developers to update their add-ons. Obviously, Mozilla wants as many add-ons as possible to be compatible with the latest version of <a href="http://www.mozilla.com/en-US/mobile/">Firefox Mobile</a>.</p>
<p>AMO (addons.mozilla.org) is ready for add-ons to set maxVersion to 1.1.*</p>
<p>Please test your add-on <strong>before</strong> bumping the version. You can use the <a href="http://starkravingfinkle.org/blog/2009/11/fennec-nightly-maemo-updates/">nightly builds for Maemo</a>, as well as the <a href="http://www.mozilla.com/en-US/mobile/getinvolved">desktop versions</a> to help test. Here are a few things to keep in mind while testing add-ons:</p>
<ul>
<li><strong>Site Menu:</strong> The site menu was <a href="http://madhava.com/egotism/archive/005043.html">redesigned</a> and uses different XUL and JS. If your add-on adds a command to the site menu, please check out the changes and update your code.</li>
<li><strong>Context Menu:</strong> Long taps (or right clicks on desktop) will display a <a href="http://starkravingfinkle.org/blog/2010/04/fennec-1-1-context-menus/">context menu</a>, but only limited targets are allowed (images, links and mailto: links). If your add-on can benefit form the context menu, use it. But use it wisely.</li>
<li><strong>Startup:</strong> When starting the browser, the Awesomebar Screen is no longer shown. A true <a href="http://madhava.com/egotism/archive/005044.html">Start Page system</a>  is now used. Adjust your add-on startup process if needed.</li>
<li><strong>Portrait Mode:</strong> Firefox for Maemo (and Android) now supports dynamic portrait/landscape orientation. Make sure your add-on <a href="http://starkravingfinkle.org/blog/2009/09/fennec-of-screens-and-orientation/">works well</a> in both orientations.</li>
<li><strong>Theme Breakage:</strong> Check to make sure the add-on is not including the <code>chrome://global/content/global.css</code> stylesheet. It will break the mobile platform CSS. An easy way to see this breakage is to look at the toggle buttons in Preferences UI. If those buttons look like checkboxes, the CSS is broken. This seems to be very common for new add-ons.</li>
<li><strong>Check for Errors:</strong> When testing the add-on, launch the browser from a terminal and use | fennec &#8211;jsconsole | to open the JS Error Console. Make sure no errors appear in the console while testing the add-on.</li>
</ul>
<p>If you have any questions, please use <a href="http://irc.mozilla.org/">Mozilla IRC</a> and join the #mobile channel. Use <a href="http://www.mibbit.com/chat/">mibbit</a> if you don&#8217;t have an IRC client. I&#8217;ll be there (mfinkle), as will many other helpful people who can help answer your questions.</p>
]]></content:encoded>
			<wfw:commentRss>http://starkravingfinkle.org/blog/2010/04/firefox-mobile-1-1-beta-1-and-add-ons/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Fennec 1.1 Context Menus</title>
		<link>http://starkravingfinkle.org/blog/2010/04/fennec-1-1-context-menus/</link>
		<comments>http://starkravingfinkle.org/blog/2010/04/fennec-1-1-context-menus/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 19:45:36 +0000</pubDate>
		<dc:creator>Mark Finkle</dc:creator>
				<category><![CDATA[Extensions]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mozilla]]></category>

		<guid isPermaLink="false">http://starkravingfinkle.org/blog/?p=713</guid>
		<description><![CDATA[Fennec 1.1 now supports context menus. Using a long tap (aka tap-n-hold), or right-click on desktop versions, you can get a context menu to appear.

We intentional designed the context menu system to be simple and minimalistic. We do not want large context menus with many, many commands. Currently, context menus are only displayed if the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.mozilla.com/en-US/mobile/">Fennec 1.1</a> now supports <a href="http://starkravingfinkle.org/blog/2010/04/firefox-mobile-1-1-whats-coming/">context menus</a>. Using a long tap (aka tap-n-hold), or right-click on desktop versions, you can get a context menu to appear.</p>
<p><img src="http://starkravingfinkle.org/blog/wp-content/uploads/2010/04/fennec-contextpanel-02-300x239.png" width="300" height="239" class="alignnone size-medium wp-image-695" /></p>
<p>We intentional designed the context menu system to be simple and minimalistic. We do not want large context menus with many, many commands. Currently, context menus are only displayed if the user long-taps on a link or an image. Technically, not all links will activate the context menu. <code>javascript:</code> links, for example will not activate the context menu.</p>
<p>Fennec 1.1 will only ship with two context menu commands: <strong>Open Link in New Tab</strong> and <strong>Save Image</strong>.</p>
<p>Add-ons can extend the context menu. Just overlay the context menu list of commands, which is <code>&lt;richlistbox id="context-commands"&gt;</code> in the XUL. Each command must have a <code>type</code> attribute and only 3 types are recognized: link, image, mailto.</p>
<p>The context menu system will automatically show/hide commands based on where the user long-taps. Under normal circumstances, the add-on will not need to worry about showing or hiding the context menu command:</p>
<ul>
<li>If an image is tapped, only <code>type="image"</code> commands will be shown.</li>
<li>If the element is an image inside a link, both types of commands will be shown.</li>
<li>If no link or image is picked, no context menu will be shown at all.</li>
</ul>
<p>Yes, this is a bit restrictive, but that&#8217;s the way we want context menus to work for now. Feedback is always appreciated and Mozilla IRC (#mobile channel) is available to help answer questions.</p>
]]></content:encoded>
			<wfw:commentRss>http://starkravingfinkle.org/blog/2010/04/fennec-1-1-context-menus/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Add-ons and Restarts &#8211; Yuck!</title>
		<link>http://starkravingfinkle.org/blog/2010/01/add-ons-and-restarts-yuck/</link>
		<comments>http://starkravingfinkle.org/blog/2010/01/add-ons-and-restarts-yuck/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 14:30:00 +0000</pubDate>
		<dc:creator>Mark Finkle</dc:creator>
				<category><![CDATA[Extensions]]></category>
		<category><![CDATA[Mozilla]]></category>

		<guid isPermaLink="false">http://starkravingfinkle.org/blog/?p=645</guid>
		<description><![CDATA[There has been a lot of discussion about the future of the Mozilla add-on infrastructure. I think it&#8217;s clear now that Mozilla is not removing the classic add-on mechanism. In fact, Fabrice Desré found a nice bit of news on an upcoming feature (via comments on Atul&#8217;s post):

Fabrice: Does the fact that jetpacks are now [...]]]></description>
			<content:encoded><![CDATA[<p>There has been a lot of discussion about the future of the Mozilla add-on infrastructure. I think it&#8217;s clear now that Mozilla is not removing the classic add-on mechanism. In fact, Fabrice Desré found a nice bit of news on an upcoming feature (via comments on <a href="http://www.toolness.com/wp/?p=746">Atul&#8217;s post</a>):</p>
<blockquote><p>
<strong><a href="http://twitter.com/fabricedesre">Fabrice</a>:</strong> Does the fact that jetpacks are now XPIs mean that the “no restart after install” feature will be implemented for traditionnal add-ons ?</p>
<p><strong><a href="http://www.toolness.com/">Atul</a>:</strong> That’s correct! We don’t have a bug filed for it yet, still need to do that, but the idea is that if an extension includes certain metadata in its install.rdf that essentially tells Firefox “look, I know how to unload all my resources reliably”, then Firefox will trust it and call a certain function whenever the extension needs to unload itself.</p>
<p><strong><a href="http://www.oxymoronical.com/">Mossop</a>:</strong> I’ll just elaborate a little. Plans are naturally in flux right now but the idea is to allow XPI packages to install without restarts if they wish, however there will be constraints. They will be responsible for doing everything themselves, which means (at least in my head right now) we won’t automatically load chrome or components from these extensions. Instead we will just do startup and shutdown calls into the extension and allow it to register/unregister what it needs by itself. This means that just marking an existing extension to work without restarts wouldn’t get you anywhere, you still need to do the extra work to handle the startup/shutdown parts.
</p></blockquote>
<p>This is great news for add-on developers! I&#8217;m sure <a href="https://developer.mozilla.org/En">MDC</a> will have some code snippets for dynamically loading chrome overlays and components to make it easy to support no-restart add-ons.</p>
]]></content:encoded>
			<wfw:commentRss>http://starkravingfinkle.org/blog/2010/01/add-ons-and-restarts-yuck/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>AdBlock Plus Adds Support for Fennec</title>
		<link>http://starkravingfinkle.org/blog/2009/12/adblock-plus-adds-support-for-fennec/</link>
		<comments>http://starkravingfinkle.org/blog/2009/12/adblock-plus-adds-support-for-fennec/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 07:00:39 +0000</pubDate>
		<dc:creator>Mark Finkle</dc:creator>
				<category><![CDATA[Extensions]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mozilla]]></category>

		<guid isPermaLink="false">http://starkravingfinkle.org/blog/?p=635</guid>
		<description><![CDATA[Thanks to Fabrice Desré and Wladimir Palant, development builds of AdBlock Plus support Fennec! The port embraces Fennec&#8217;s minimalistic design asthetic &#8211; exposing only a simple options UI. However, this is more than enough to make a great impact on browsing in Fennec.

Besides reducing the visual clutter on web pages, ad-heavy pages load noticeably faster! [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks to <a href="http://twitter.com/fabricedesre">Fabrice Desré</a> and <a href="http://adblockplus.org/blog/">Wladimir Palant</a>, development builds of <a href="http://adblockplus.org/development-builds/fennec-support-and-signed-builds">AdBlock Plus support Fennec</a>! The port embraces Fennec&#8217;s minimalistic design asthetic &#8211; exposing only a simple options UI. However, this is more than enough to make a great impact on browsing in Fennec.</p>
<p><img src="http://starkravingfinkle.org/blog/wp-content/uploads/2009/12/fennec-adblockplus-options-small.png" alt="fennec-adblockplus-options-small" title="fennec-adblockplus-options-small" width="500" height="312" class="alignnone size-full wp-image-639" /></p>
<p>Besides reducing the visual clutter on web pages, ad-heavy pages load noticeably faster! As Wladimir notes in his post, AdBlock Plus will only work in nightly builds of Fennec (version 1.0b6pre). Install a <a href="http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mobile-1.9.2/">nightly version</a> (including desktop versions) or use the new <a href="http://starkravingfinkle.org/blog/2009/11/fennec-nightly-maemo-updates/">nightly update channel</a> from your Maemo device. He also mentions that work to improve the first-run experience is coming in future releases.</p>
<p>Install a development build of AdBlock Plus by navigating to <a href="https://adblockplus.org/devbuilds/adblockplus/">https://adblockplus.org/devbuilds/adblockplus/</a> using Fennec and click on the most recent XPI file. Fennec will step you through installing the add-on.</p>
]]></content:encoded>
			<wfw:commentRss>http://starkravingfinkle.org/blog/2009/12/adblock-plus-adds-support-for-fennec/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Fennec &#8211; Let&#8217;s Build Some Add-ons</title>
		<link>http://starkravingfinkle.org/blog/2009/09/fennec-lets-build-some-add-ons/</link>
		<comments>http://starkravingfinkle.org/blog/2009/09/fennec-lets-build-some-add-ons/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 04:35:26 +0000</pubDate>
		<dc:creator>Mark Finkle</dc:creator>
				<category><![CDATA[Extensions]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mozilla]]></category>

		<guid isPermaLink="false">http://starkravingfinkle.org/blog/?p=531</guid>
		<description><![CDATA[We&#8217;re in the last weeks of development before releasing Fennec 1.0 to the world. There has been a lot of great testing and feedback. I think we have a well defined set of things to work on for 1.0 and a good idea of what we want to look at for 1.0+.
However, there is one [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re in the last weeks of development before releasing Fennec 1.0 to the world. There has been a lot of great testing and feedback. I think we have a well defined set of things to work on for 1.0 and a good idea of what we want to look at for 1.0+.</p>
<p>However, there is one area I think we haven&#8217;t had enough testing and feedback &#8211; add-on development in Fennec. Add-on developers are a tricky bunch. They can make you re-think your architecture, brainstorm many new features and find lot&#8217;s of hidden bugs. We need more developers working on Fennec add-ons.</p>
<p>We have a small, but growing collection of Fennec-specific add-on developer resources. If you&#8217;re interested in building add-ons for Fennec, here&#8217;s a list of resources you might find helpful:</p>
<ul>
<li><a href="https://wiki.mozilla.org/Mobile/Fennec/Architecture">Architecture Overview</a></li>
<li><a href="https://wiki.mozilla.org/Mobile/Fennec/Extensions">Extensions Basics</a> &#8211; Look here first</li>
<li><a href="https://wiki.mozilla.org/Mobile/Fennec/CodeSnippets">Code Snippets</a> &#8211; Doing things in Fennec might be different than Firefox</li>
<li><a href="https://wiki.mozilla.org/Mobile/Fennec/Extensions/BestPractices">Best Practices for Building Extensions</a></li>
<li><a href="https://wiki.mozilla.org/Mobile/Fennec/Extensions/Options">Creating an Options UI for an Extension</a></li>
<li><a href="https://wiki.mozilla.org/Mobile/Fennec/Extensions/Layout">Tips for Creating a Robust UI</a> &#8211; XUL and CSS to the rescue</li>
</ul>
<p>The documents have been, and will continue to be updated. Feel free to give feedback on any of the documents. What information or snippets are missing? Use comments, <a href="http://irc.mozilla.org">IRC channels</a> (#mobile) or even <a href="https://bugzilla.mozilla.org/enter_bug.cgi?product=Fennec">file some bugs</a>.</p>
<p><a href="http://www.mozilla.org/projects/fennec/1.0b3/releasenotes/">Fennec for Maemo</a> and <a href="http://www.mozilla.org/projects/fennec/1.0a3-wm/releasenotes/">Fennec for Windows Mobile</a> both support add-ons. In fact, the same add-on could be used on both platforms. So get out there are start building.</p>
<p>Oh, one thing I wanted to ask before you go. What features of a mobile device would make building mobile add-ons really kick ass? Support for geo-location? Accessing the camera? Making calls or sending SMS? Leave comments and please go into detail <img src='http://starkravingfinkle.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://starkravingfinkle.org/blog/2009/09/fennec-lets-build-some-add-ons/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Fennec &#8211; Handling Add-on Options</title>
		<link>http://starkravingfinkle.org/blog/2009/09/fennec-handling-add-on-options/</link>
		<comments>http://starkravingfinkle.org/blog/2009/09/fennec-handling-add-on-options/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 14:23:28 +0000</pubDate>
		<dc:creator>Mark Finkle</dc:creator>
				<category><![CDATA[Extensions]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[XUL]]></category>

		<guid isPermaLink="false">http://starkravingfinkle.org/blog/?p=522</guid>
		<description><![CDATA[The add-on (extension) mechanism built into the Mozilla platform is very powerful. One of the optional features is support for options (preferences) dialogs. As discussed in my last post, Fennec doesn&#8217;t like dialogs. In addition, Fennec has a simple, clean preference system. While designing the Fennec Add-ons Manager, we discussed how we would support add-on [...]]]></description>
			<content:encoded><![CDATA[<p>The add-on (extension) mechanism built into the Mozilla platform is very powerful. One of the optional features is support for options (preferences) dialogs. As discussed in my <a href="http://starkravingfinkle.org/blog/2009/09/fennec-prompts-alerts-and-dialogs-oh-my/">last post</a>, Fennec doesn&#8217;t like dialogs. In addition, Fennec has a simple, clean preference system. While designing the Fennec Add-ons Manager, we discussed how we would support add-on options. We didn&#8217;t want popup dialogs of random and complicated XUL.</p>
<p>After brainstorming a few ideas, we settled on a simple idea. Fennec uses special <code>&lt;setting&gt;</code> XUL tags to create it&#8217;s list of preferences. Add-ons would be forced to use the same tags. The options would be merged into the Fennec Add-on Manager, not displayed as a popup dialog. Of course, add-ons can support more than one application, so we needed to make sure that the options XUL for Fennec could coexist with the options XUL for other applications. Let&#8217;s take a look at how this all works:</p>
<p><strong>Install Manifest</strong></p>
<p>Add-ons use install.rdf to identify the XUL used for displaying the preferences. This is optional.</p>
<p><code>
&lt;em:optionsURL&gt;chrome://myaddon/content/options.xul&lt;/em:optionsURL&gt;
</code></p>
<p>This is needed for any add-on that wants to use an options dialog.</p>
<p><strong>Chrome Manifest</strong></p>
<p>Add-ons use the <a href="https://developer.mozilla.org/en/Chrome_Registration">chrome manifest</a> to selectively <a href="https://developer.mozilla.org/en/Chrome_Registration#override">override</a> XUL, and other resources, between different applications using the <a href="https://developer.mozilla.org/en/Chrome_Registration#application">application flags</a></p>
<p><code>
override chrome://myaddon/content/options.xul chrome://myaddon/content/fennec-options.xul application={a23983c0-fd0e-11dc-95ff-0800200c9a66}
</code></p>
<p>This will tell Mozilla to use <code>fennec-options.xul</code> anytime the <code>options.xul</code> resource is requested.</p>
<p><strong>Options XUL</strong></p>
<p>As I said, the XUL allowed for the Fennec options system is limited to a <a href="http://mxr.mozilla.org/mobile-browser/source/chrome/content/preferences/setting.xml">few new tags</a>. Here is an example of a Fennec options dialog:</p>
<pre><code>
&lt;?xml version="1.0"?&gt;

&lt;!DOCTYPE mydialog SYSTEM "chrome://myextension/locale/mydialog.dtd"&gt;

&lt;vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt;
  &lt;setting pref="extensions.myaddon.debugging" type="boolint" on="1" off="2" title="Enable debugging"/&gt;
  &lt;setting pref="extensions.myaddon.profiling" type="bool" title="Enable profiling"&gt;
    Profiling can affect the performance of the application
  &lt;/setting&gt;
  &lt;setting pref="extensions.myaddon.logging" type="bool" title="Save logs"/&gt;
  &lt;setting pref="extensions.myaddon.logging.path" type="string" title="Log folder"/&gt;
  &lt;setting type="button" title="Clear logs"&gt;
    &lt;button label="Clear" oncommand="MyAddon.clearLogs();"/&gt;
  &lt;/setting&gt;
&lt;/vbox&gt;
</code></pre>
<p>Note that we don&#8217;t have any <code>&lt;script&gt;</code> support and we are limited to <code>&lt;setting&gt;</code> tags. The root <code>&lt;vbox&gt;</code> just acts as a container, it isn&#8217;t merged into the main window. Here is how the options look in Fennec:</p>
<p><a href="http://people.mozilla.com/~mfinkle/fennec/screenshots/fennec-addon-options-sample.png"><img alt="" src="http://people.mozilla.com/~mfinkle/fennec/screenshots/fennec-addon-options-sample.png" title="Options Sample" class="alignnone" width="400" height="250" /></a></p>
<p>As always, we appreciate your feedback. I&#8217;m in the process of updating the <a href="https://wiki.mozilla.org/Mobile/Fennec/Extensions/BestPractices">Fennec Best Practices</a> documents with this information.</p>
<p>A big <strong>thank you</strong> goes out to Vivien Nicolas, a Mozilla intern in the Paris office, for turning my <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=512882">super-great design</a> into a reality. Shaver told me there&#8217;d be days like this!</p>
]]></content:encoded>
			<wfw:commentRss>http://starkravingfinkle.org/blog/2009/09/fennec-handling-add-on-options/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Fennec &#8211; Prompts, Alerts and Dialogs &#8211; Oh My</title>
		<link>http://starkravingfinkle.org/blog/2009/09/fennec-prompts-alerts-and-dialogs-oh-my/</link>
		<comments>http://starkravingfinkle.org/blog/2009/09/fennec-prompts-alerts-and-dialogs-oh-my/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 13:25:45 +0000</pubDate>
		<dc:creator>Mark Finkle</dc:creator>
				<category><![CDATA[Extensions]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[XPCOM]]></category>
		<category><![CDATA[XUL]]></category>

		<guid isPermaLink="false">http://starkravingfinkle.org/blog/?p=512</guid>
		<description><![CDATA[If you&#8217;ve developed applications or extensions using the Mozilla platform, you know that there are tons of services and APIs available. We use those same capabilities when building Fennec. However, there are times when the default platform behavior is not desirable on mobile devices. When that happens, we could hack up our own system, or [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve developed applications or extensions using the Mozilla platform, you know that there are tons of services and APIs available. We use those same capabilities when building Fennec. However, there are times when the default platform behavior is not desirable on mobile devices. When that happens, we could hack up our own system, or we could re-implement the platform APIs to suit our needs. We try to do the latter.</p>
<p>Here are some APIs that have been reimplemented in Fennec: <a href="https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIAlertsService">nsIAlertsService</a>, <a href="https://developer.mozilla.org/en/nsIPromptService">nsIPromptService</a>, <a href="https://developer.mozilla.org/en/nsIDownloadManagerUI">nsIDownloadManagerUI</a>, and <a href="https://developer.mozilla.org/en/DOM/window.openDialog">window.openDialog()</a>. The primary reason all of these APIs have been reimplemented is that they open new XUL windows. We don&#8217;t like doing that in Fennec. Mostly because opening a XUL window is slow. But also because we love having tighter control over the look, feel and behavior of the UI elements.</p>
<p><strong>Services</strong></p>
<p>Since we re-implement the interfaces, <code>nsIAlertsService</code>, <code>nsIPromptService</code> and <code>nsIDownloadManagerUI</code> can be used just as they are on the desktop. The big difference is that none of them open new windows. The UI is embedded into the main window itself. It&#8217;s faster to display and easier to control and style the UI elements. In the case of the download manager, it&#8217;s designed to be embedded in the main window.</p>
<p><strong>Dialogs</strong></p>
<p>On the other hand, we couldn&#8217;t exactly match the way <code>window.openDialog()</code> worked, so we created a slightly different API: <code>importDialog()</code>. The big difference is that <code>importDialog()</code> actually merges the XUL dialog into the main window. It does not open a new XUL window.</p>
<p><code>
importDialog(aSrc, aArguments);
</code></p>
<ul>
<li><code>aSrc</code>: The chrome URL of the XUL dialog</li>
<li><code>aArguments</code>: A JavaScript object used to pass data to the dialog</li>
</ul>
<p>The XUL passed to <code>importDialog()</code> is very similar to XUL passed to <code>window.openDialog()</code>, with some limitations and caveats:</p>
<ul>
<li>Only <code>&lt;dialog&gt;</code> top level elements are permitted</li>
<li>Scripts are loaded via an attribute on the <code>&lt;dialog&gt;</code> element, not via the <code>&lt;script&gt;</code> tag</li>
</ul>
<p>Here is an example:</p>
<pre><code>
&lt;?xml version="1.0"?&gt;
&lt;!DOCTYPE mydialog SYSTEM "chrome://myextension/locale/mydialog.dtd"&gt;
&lt;dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
      script="chrome://myextension/content/mydialog.js"&gt;
  
  &lt;label id="mydialog-title" crop="center"/&gt;

... some other widgets ...

  &lt;hbox pack="center"&gt;
    &lt;button label="&amp;ok.label;" oncommand="myDialog.doSomething();"/&gt;
  &lt;/hbox&gt;
&lt;/dialog&gt;
</code></pre>
<p>The XUL is merged into the existing window, almost like a XUL overlay. Because of this, element ID and JavaScript conflicts are possible, just like overlays. So be careful!</p>
<p>Obviously, add-on developers should use these features. We are looking for feedback as well. Perhaps we could get <code>importDialog()</code> working more like <code>window.openDialog()</code>.</p>
<p>A big <strong>thank you</strong> goes out to Fabrice Desré for working on <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=489423">reimplementing nsIPromptService</a>. He created some great building blocks for Fennec.</p>
]]></content:encoded>
			<wfw:commentRss>http://starkravingfinkle.org/blog/2009/09/fennec-prompts-alerts-and-dialogs-oh-my/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fennec &#8211; Of Screens and Orientation</title>
		<link>http://starkravingfinkle.org/blog/2009/09/fennec-of-screens-and-orientation/</link>
		<comments>http://starkravingfinkle.org/blog/2009/09/fennec-of-screens-and-orientation/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 03:37:56 +0000</pubDate>
		<dc:creator>Mark Finkle</dc:creator>
				<category><![CDATA[Extensions]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[XUL]]></category>

		<guid isPermaLink="false">http://starkravingfinkle.org/blog/?p=495</guid>
		<description><![CDATA[Designing a portable application to run on many different mobile devices is a challenge. Screen sizes and pixel densities are different making it difficult to create the One Great Layout. In addition, mobile devices can change screen orientation, from portrait to landscape and back again.
This is one area where using a markup-based UI language like [...]]]></description>
			<content:encoded><![CDATA[<p>Designing a portable application to run on many different mobile devices is a challenge. Screen sizes and pixel densities are different making it difficult to create the <strong>One Great Layout</strong>. In addition, mobile devices can change screen orientation, from portrait to landscape and back again.</p>
<p>This is one area where using a markup-based UI language like <a href="https://developer.mozilla.org/en/XUL_Tutorial">XUL</a>, with it&#8217;s support for CSS, comes in handy. Currently, Fennec is being designed and tested to run on Nokia&#8217;s N810 &#038; <a href="http://www.techradar.com/news/phone-and-communications/mobile-phones/firefox-mobile-on-nokia-n900-first-screenshots-631189">N900</a> devices, HTC&#8217;s Touch Pro and Samsung&#8217;s Omnia &#038; Omnia II. Yes, Fennec can run on other Windows Mobile devices, but we don&#8217;t really test on every possible device&#8230; yet. <a href="http://elvis314.wordpress.com/">Joel</a> and the QA crew are working on that, but I digress.</p>
<p>Even with the target devices, we have several screen sizes, pixel densities and orientation requirements to support. Layout support in XUL and media query support in CSS really do the heavy lifting for us. The Fennec UI is the same on all these devices, but we have some layout constraints and CSS rules that allow us to morph the UI as the screen changes. Here are some of the ways we do it:</p>
<ul>
<li>Use physical dimensions whenever possible. Padding and margins are set using millimeters, not pixels. This minimizes the need for special rules for every different screen size and pixel density. Also, the UI is designed for touch, and the current design size for a touchable UI element is ~7.5mm. Your finger doesn&#8217;t change sizes to match the screen <img src='http://starkravingfinkle.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>Use <a href="https://developer.mozilla.org/En/CSS/Media_queries">CSS media queries</a> to switch between screen sizes and pixel densities. Large sized images can be used on large screens/densities, while smaller images can be used on smaller screens/densities. The result should be an image that is roughly the same physical size on either device. </li>
<li>Use CSS media queries and <a href="https://developer.mozilla.org/en/CSS_Reference/Mozilla_Extensions">XUL box rules</a> to flow the UI when the device is rotated. A toolbar that works well vertically in landscape orientation, probably needs to flow horizontally in portrait orientation. It&#8217;s all about maximizing the usable space.</li>
</ul>
<p><strong>Screen Size</strong></p>
<p>Here is some example CSS we use for toggling between large and small screens/densities. As you can see, we use 400px as a cutoff:</p>
<pre><code>
/* high-res screens */
@media all and (min-device-width: 401px) {
  toolbarbutton {
    min-width: 64px !important; /* primary button size (match image pixels)*/
    min-height: 64px !important; /* primary button size (match image pixels) */
  }
}

/* low-res screens */
@media all and (max-device-width: 400px) {
  toolbarbutton {
    min-width: 36px !important; /* primary button size (match image pixels) */
    min-height: 36px !important; /* primary button size (match image pixels) */
  }
}
</code></pre>
<p><strong>Orientation</strong></p>
<p>The same kind of example, but this time for changing the direction of some UI elements when rotating the screen:</p>
<pre><code>
@media (orientation: landscape) {
  #panel-controls {
    -moz-box-orient: vertical;
    -moz-box-ordinal-group: 1; /* move to left of screen */
    -moz-box-pack: end; /* force children to align to bottom of screen */
  }
}

@media (orientation: portrait) {
  #panel-controls {
    -moz-box-orient: horizontal;
    -moz-box-ordinal-group: 1000; /* move to the bottom of the screen */
    -moz-box-pack: start; /* force children to align to left of screen */
  }
}
</code></pre>
<p><a href="http://people.mozilla.com/~mfinkle/fennec/screenshots/fennec-options-landscape.png"><img alt="Landscape" src="http://people.mozilla.com/~mfinkle/fennec/screenshots/fennec-options-landscape.png" title="Landscape" width="400" height="250" /></a></p>
<p><a href="http://people.mozilla.com/~mfinkle/fennec/screenshots/fennec-options-portrait.png"><img alt="Portrait" src="http://people.mozilla.com/~mfinkle/fennec/screenshots/fennec-options-portrait.png" title="Portrait" width="250" height="400" /></a></p>
<p>We also use the <a href="http://starkravingfinkle.org/blog/2008/06/xul-tip-wrapping-boxes/">XUL box wrapping tip</a>, I discussed previously, to allow elements to flow into multiple rows if there is not enough space to hold them in a single row.</p>
<p>If you&#8217;re developing add-ons for Fennec, please keep these situations in mind. Use the <a href="http://mxr.mozilla.org/mobile-browser/">Fennec code</a> as an example of how you can create a great user experience, regardless of screen size or orientation.</p>
]]></content:encoded>
			<wfw:commentRss>http://starkravingfinkle.org/blog/2009/09/fennec-of-screens-and-orientation/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>New Life for Old Projects</title>
		<link>http://starkravingfinkle.org/blog/2009/09/new-life-for-old-projects/</link>
		<comments>http://starkravingfinkle.org/blog/2009/09/new-life-for-old-projects/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 13:35:36 +0000</pubDate>
		<dc:creator>Mark Finkle</dc:creator>
				<category><![CDATA[Extensions]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[XUL]]></category>

		<guid isPermaLink="false">http://starkravingfinkle.org/blog/?p=484</guid>
		<description><![CDATA[So much to do, so little time. My workspace is littered with projects I started but couldn&#8217;t find the time to keep going. It&#8217;s kinda sad and I do feel guilty.
Sometimes those projects find a new life. Recently, two of my old projects found new life: FizzyPop and js-ctypes are both active again.
Doug Warner has [...]]]></description>
			<content:encoded><![CDATA[<p>So much to do, so little time. My workspace is littered with projects I started but couldn&#8217;t find the time to keep going. It&#8217;s kinda sad and I do feel guilty.</p>
<p>Sometimes those projects find a new life. Recently, two of my old projects found new life: <a href="https://wiki.mozilla.org/FizzyPop">FizzyPop</a> and <a href="https://wiki.mozilla.org/JSctypes">js-ctypes</a> are both active again.</p>
<p><a href="http://www.mozdev.org/drupal/blog/17">Doug Warner</a> has started <a href="http://www.mozdev.org/drupal/blog/Project-Wizard-Get-Started-Your-Idea-without-Mundane-Setup">building</a> a Mozilla Project Wizard on the FizzyPop source code. Doug is requesting feedback for <a href="http://www.mozdev.org/drupal/blog/Help-Improve-Project-Wizard-Jetpack-JS-Modules-and-More">improvements</a>. You can try it out <a href="http://www.mozdev.org/projects/wizard">here</a>.</p>
<p>Dan Witte has started looking into moving js-ctypes into the <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=513783">Mozilla tree</a>! There are also plans to add a nice JavaScript <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=513788">wrapper</a> API around the XPCOM too.</p>
<p>I feel less guilty now.</p>
]]></content:encoded>
			<wfw:commentRss>http://starkravingfinkle.org/blog/2009/09/new-life-for-old-projects/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
