<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Wanted: ProductName/Version</title>
	<atom:link href="http://robert.accettura.com/blog/2005/05/20/wanted-productnameversion/feed/" rel="self" type="application/rss+xml" />
	<link>http://robert.accettura.com/blog/2005/05/20/wanted-productnameversion/</link>
	<description>Robert Accettura&#039;s Personal Blog on Web Development and Tech</description>
	<lastBuildDate>Thu, 18 Mar 2010 15:46:47 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: helo</title>
		<link>http://robert.accettura.com/blog/2005/05/20/wanted-productnameversion/comment-page-1/#comment-3688</link>
		<dc:creator>helo</dc:creator>
		<pubDate>Fri, 20 May 2005 22:08:54 +0000</pubDate>
		<guid isPermaLink="false">http://robert.accettura.com/?p=739#comment-3688</guid>
		<description>The PasteIP extension seems to get it right, in Ff at least so maybe there is some magic there???</description>
		<content:encoded><![CDATA[<p>The PasteIP extension seems to get it right, in Ff at least so maybe there is some magic there???</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gerald</title>
		<link>http://robert.accettura.com/blog/2005/05/20/wanted-productnameversion/comment-page-1/#comment-3687</link>
		<dc:creator>Gerald</dc:creator>
		<pubDate>Fri, 20 May 2005 20:04:34 +0000</pubDate>
		<guid isPermaLink="false">http://robert.accettura.com/?p=739#comment-3687</guid>
		<description>doh! you all make firefox. and you can&#039;t even get your own product&#039;s version number. So much for F/oss.</description>
		<content:encoded><![CDATA[<p>doh! you all make firefox. and you can&#8217;t even get your own product&#8217;s version number. So much for F/oss.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Myk Melez</title>
		<link>http://robert.accettura.com/blog/2005/05/20/wanted-productnameversion/comment-page-1/#comment-3686</link>
		<dc:creator>Myk Melez</dc:creator>
		<pubDate>Fri, 20 May 2005 19:31:02 +0000</pubDate>
		<guid isPermaLink="false">http://robert.accettura.com/?p=739#comment-3686</guid>
		<description>Here&#039;s a function from Forumzilla that might help.  It uses nsIXULAppInfo on Aviary 1.1 apps, the app.id preference on Aviary 1.0 apps, and assumes Seamonkey if neither value is available.  It&#039;s designed to distinguish between Seamonkey and Thunderbird but should be easily modifiable to determine if it&#039;s running in Firefox or some other XUL app.

&lt;pre lang=&quot;javascript&quot;&gt;
var gAppName;
function getAppName() {
    if (gAppName)
        return gAppName;

    try {
        // Aviary 1.1 apps store application meta-data in the app info component.
        var appInfo =
          Components
            .classes[&quot;@mozilla.org/xre/app-info;1&quot;]
              .getService(Components.interfaces.nsIXULAppInfo);
        if (appInfo &amp;&amp; appInfo.ID == &quot;{3550f703-e582-4d05-9a08-453d09bdfdc6}&quot;) {
            gAppName = &quot;Thunderbird&quot;;
            debug(&quot;determined application to be Thunderbird via nsIXULAppInfo&quot;);
            return gAppName;
        }
        debug(&quot;could not determine application via nsIXULAppInfo: &quot; + appInfo);
    }
    catch(e) {
        debug(e);
    }
    
    try {
        // Aviary 1.0 apps store application meta-data in a preference.
        var id =
          Components
            .classes[&quot;@mozilla.org/preferences-service;1&quot;]
              .getService(Components.interfaces.nsIPrefService)
                .getBranch(&quot;app.&quot;)
                  .getCharPref(&quot;id&quot;);
        if (id &amp;&amp; id == &quot;{3550f703-e582-4d05-9a08-453d09bdfdc6}&quot;) {
            gAppName = &quot;Thunderbird&quot;;
            debug(&quot;determined application to be Thunderbird via app.id pref&quot;);
            return gAppName;
        }
        debug(&quot;could not determine application via app.id pref: &quot; + id);
    }
    catch(e) {
        debug(e);
    }

    // Non-aviary apps (f.e. Seamonkey) don&#039;t store application meta-data.
    debug(&quot;could not determine application; assuming Seamonkey&quot;);
    gAppName = &quot;Seamonkey&quot;;
    return gAppName;
}
&lt;/pre&gt;
*Edit:* robert 5/20/05 3:34 - parse code for readability.</description>
		<content:encoded><![CDATA[<p>Here&#8217;s a function from Forumzilla that might help.  It uses nsIXULAppInfo on Aviary 1.1 apps, the app.id preference on Aviary 1.0 apps, and assumes Seamonkey if neither value is available.  It&#8217;s designed to distinguish between Seamonkey and Thunderbird but should be easily modifiable to determine if it&#8217;s running in Firefox or some other XUL app.</p>
<pre>

var gAppName;
function getAppName() {
    if (gAppName)
        return gAppName;

    try {
        // Aviary 1.1 apps store application meta-data in the app info component.
        var appInfo =
          Components
            .classes[&quot;@mozilla.org/xre/app-info;1&quot;]
              .getService(Components.interfaces.nsIXULAppInfo);
        if (appInfo &amp;amp;&amp;amp; appInfo.ID == &quot;{3550f703-e582-4d05-9a08-453d09bdfdc6}&quot;) {
            gAppName = &quot;Thunderbird&quot;;
            debug(&quot;determined application to be Thunderbird via nsIXULAppInfo&quot;);
            return gAppName;
        }
        debug(&quot;could not determine application via nsIXULAppInfo: &quot; + appInfo);
    }
    catch(e) {
        debug(e);
    }

    try {
        // Aviary 1.0 apps store application meta-data in a preference.
        var id =
          Components
            .classes[&quot;@mozilla.org/preferences-service;1&quot;]
              .getService(Components.interfaces.nsIPrefService)
                .getBranch(&quot;app.&quot;)
                  .getCharPref(&quot;id&quot;);
        if (id &amp;amp;&amp;amp; id == &quot;{3550f703-e582-4d05-9a08-453d09bdfdc6}&quot;) {
            gAppName = &quot;Thunderbird&quot;;
            debug(&quot;determined application to be Thunderbird via app.id pref&quot;);
            return gAppName;
        }
        debug(&quot;could not determine application via app.id pref: &quot; + id);
    }
    catch(e) {
        debug(e);
    }

    // Non-aviary apps (f.e. Seamonkey) don't store application meta-data.
    debug(&quot;could not determine application; assuming Seamonkey&quot;);
    gAppName = &quot;Seamonkey&quot;;
    return gAppName;
}
</pre>
<p>*Edit:* robert 5/20/05 3:34 &#8211; parse code for readability.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
