<?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>code-diesel &#187; browser</title>
	<atom:link href="http://www.codediesel.com/tag/browser/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codediesel.com</link>
	<description>/* PHP &#38; MySQL Journal */</description>
	<lastBuildDate>Thu, 02 Feb 2012 13:19:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Pushing xpi mime content from php</title>
		<link>http://www.codediesel.com/php/sending-xpi-mime-content-from-php/</link>
		<comments>http://www.codediesel.com/php/sending-xpi-mime-content-from-php/#comments</comments>
		<pubDate>Fri, 15 May 2009 04:01:49 +0000</pubDate>
		<dc:creator>sameer</dc:creator>
				<category><![CDATA[browser]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[mime]]></category>

		<guid isPermaLink="false">http://www.codediesel.com/?p=880</guid>
		<description><![CDATA[A couple of days back I created a Firefox toolbar for my blog as an experiment in learning XUL. Once installed on my blog I wanted Firefox to recognize it as an addon and install it rather than displaying a &#8216;save/open&#8217; dialog. For that I needed to add the following directive to the servers .htaccess [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of days back I created a Firefox toolbar for my blog as an experiment in learning XUL. Once installed on my blog I wanted Firefox to recognize it as an addon and install it rather than displaying a &#8216;save/open&#8217; dialog. For that I needed to add the following directive to the servers .htaccess file.<br />
<span id="more-880"></span></p>

<div class="wp_codebox"><table><tr id="p8803"><td class="code" id="p880code3"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">AddType</span> application/x-xpinstall .xpi</pre></td></tr></table></div>

<p>But the problem was that my server (godaddy) for some mysterious reasons was not recognizing the above directive. Searching around I found that godaddy has some restrictions on the various htaccess directives (yuck!). After fiddling for some time I finally had to try another solution. </p>
<p>What the Apache &#8216;AddType&#8217; directive does is that it maps the given filename extension onto the specified MIME content type, so that the browser can understand what it is supposed to do with the content. If we could replicate that in PHP than we are good. A possible solution that worked for me is shown below. You can also use the idea for other MIME types.</p>

<div class="wp_codebox"><table><tr id="p8804"><td class="code" id="p880code4"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
&nbsp;
<span style="color: #009933; font-style: italic;">/* File we want to send to the browser */</span>
<span style="color: #000088;">$filename</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;codediesel.xpi&quot;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #009933; font-style: italic;">/**
 * The following header is required for browsers that do not
 * recognize the xpi extension. i.e all browsers other than Firefox.
 * This will display the familiar 'save/open' dialog if the xpi
 * extension is not supported.
 */</span>
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-Disposition: filename=<span style="color: #006699; font-weight: bold;">{$filename}</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #009933; font-style: italic;">/* Tell the browser that the content that is coming is an xpinstall */</span>
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-type: application/x-xpinstall'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #009933; font-style: italic;">/* Also send the content length */</span>
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-Length: '</span> <span style="color: #339933;">.</span> <span style="color: #990000;">filesize</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$filename</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #009933; font-style: italic;">/* readfile reads the file content and echos it to the output */</span>
<span style="color: #990000;">readfile</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$filename</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Of course if the filesize is large the <em>readfile</em> function could possibly incur a performance hit. But for small files it works good.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codediesel.com/php/sending-xpi-mime-content-from-php/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Google Chrome benchmarks</title>
		<link>http://www.codediesel.com/javascript/google-chrome-benchmarks/</link>
		<comments>http://www.codediesel.com/javascript/google-chrome-benchmarks/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 08:55:25 +0000</pubDate>
		<dc:creator>sameer</dc:creator>
				<category><![CDATA[google]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.codediesel.com/?p=97</guid>
		<description><![CDATA[Google Chrome Beta for Windows is finally here. There are many factors that make this browser interesting; being open source and using the WebKit rendering engine is one of them. But one of the great things is the speed of the JavaScript engine. Chrome uses Google&#8217;s open source V8 JavaScript engine, and it is amazingly [...]]]></description>
			<content:encoded><![CDATA[<p>Google Chrome Beta for Windows is finally here. There are many factors that make this browser interesting; being open source and using the WebKit rendering engine is one of them. But one of the great things is the speed of the JavaScript engine. Chrome uses Google&#8217;s open source <a href="http://www.google.com/chrome/" target="_blank">V8</a> JavaScript engine, and it is amazingly fast. I ran the <a href="http://www2.webkit.org/perf/sunspider-0.9/sunspider.html" target="_blank">SunSpider 0.9</a> benchmark and here are the results:<br />
<span id="more-97"></span><br />
<a href="http://www.codediesel.com/wp-content/uploads/2008/09/chrome_benchmark1.gif"><img class="aligncenter" style="border: 1px solid #c0c0c0;" title="chrome_benchmark1" src="http://www.codediesel.com/wp-content/uploads/2008/09/chrome_benchmark1.gif" alt="google chrome benchmarks" width="519" height="310" /></a></p>
<p>As you can see it is blazingly fast, being twice as fast as Firefox 3 and twenty times faster than Internet Explorer 6.  If you are using JavaScript heavy applications like Gmail or Javascript UI frameworks like Yahoo UI, extJS, jQuery etc. than you can really reap the benefits of a fast engine. If you like to see a visual comparison try running one of John Resig&#8217;s <a title="processing.js demo" href="http://ejohn.org/apps/processing.js/examples/topics/reach3.html" target="_blank">Processing.js demo</a> in Firefox 3 and Chrome and you can see how fast Chrome can run JavaScript.</p>
<p>Some of the other interesting things Google Chrome offers can be read in a comic format <a href="http://www.google.com/googlebooks/chrome/" target="_blank">here</a> &#8211; designed by the brilliant <a title="scott mccloud" href="http://www.scottmccloud.com/" target="_blank">Scott McCloud</a>, a sample page is shown below.</p>
<p><a href="http://www.codediesel.com/wp-content/uploads/2008/09/chrome_comic.gif"><img class="aligncenter size-full wp-image-99" style="border: 1px solid #c0c0c0;" title="chrome_comic" src="http://www.codediesel.com/wp-content/uploads/2008/09/chrome_comic.gif" alt="" width="358" height="509" /></a></p>
<p>You can download Google Chrome <a href="http://www.google.com/chrome/" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codediesel.com/javascript/google-chrome-benchmarks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Internet Explorer 8 WebSlices</title>
		<link>http://www.codediesel.com/microsoft/ie8-webslices/</link>
		<comments>http://www.codediesel.com/microsoft/ie8-webslices/#comments</comments>
		<pubDate>Thu, 14 Aug 2008 05:59:19 +0000</pubDate>
		<dc:creator>sameer</dc:creator>
				<category><![CDATA[microsoft]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.codediesel.com/?p=84</guid>
		<description><![CDATA[WebSlices, what? Internet Explorer 8 has introduced a new feature, WebSlices. In a nutshell, WebSlices enable websites to connect with users by allowing them subscribe to content directly within a webpage. WebSlices behave just like RSS feeds, but instead of subscribing to XML feeds you subscribe to portions of a particular website and receive updates [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.codediesel.com/wp-content/uploads/2008/08/ie84.gif"><img class="alignleft size-full wp-image-88" style="border:1px solid #c0c0c0;" title="ie84" src="http://www.codediesel.com/wp-content/uploads/2008/08/ie84.gif" alt="ie 8 webslices" width="347" height="102" /></a><strong>WebSlices, what?</strong><br />
Internet Explorer 8 has introduced a new feature, WebSlices. In a nutshell, WebSlices enable websites to connect with users by allowing them subscribe to  content directly within a webpage. WebSlices behave just like RSS feeds, but instead of subscribing to XML feeds you subscribe to portions of a particular website and receive updates when the content  changes. The slices corresponding to a particular website are polled at user-defined intervals to keep the content fresh.</p>
<p>With the help of WebSlices you can keep your users connected to your site. Any content on your site that regularly changes can be tagged as a WebSlice. For e.g products, horoscopes, weather, stocks, news, photos.</p>
<p><span id="more-84"></span>For example ebay has a search page for ie8 that supports WebSlice. Lets say I have to track a particular product on eBay for bid amount and other details. Whenever you navigate to a website that supports WebSlice a discovery button highlights as show below for the following url: http://ie8.ebay.com/</p>
<p><a href="http://www.codediesel.com/wp-content/uploads/2008/08/ie81.gif"><img class="aligncenter size-full wp-image-85" style="border:1px solid #c0c0c0;" title="ie81" src="http://www.codediesel.com/wp-content/uploads/2008/08/ie81.gif" alt="" width="469" height="106" /></a></p>
<p>Now whenever you hover over a portion of a WebSlice, a icon pops up which you can click so as to add the WebSlice to your favorites bar.</p>
<p><a href="http://www.codediesel.com/wp-content/uploads/2008/08/ie82.gif"><img class="aligncenter size-full wp-image-86" style="border:1px solid #c0c0c0;" title="ie82" src="http://www.codediesel.com/wp-content/uploads/2008/08/ie82.gif" alt="" width="469" height="166" /></a></p>
<p>Shown below is the WebSlice for the above link.</p>
<p><a href="http://www.codediesel.com/wp-content/uploads/2008/08/ie83.gif"><img class="aligncenter size-full wp-image-87" style="border:1px solid #c0c0c0;" title="ie83" src="http://www.codediesel.com/wp-content/uploads/2008/08/ie83.gif" alt="" width="469" height="274" /></a></p>
<p>Whenever the content for this particular portion changes, the corresponding WebSlice is automatically updated. Now I don&#8217;t have to visit eBay to see the latest update on the product I&#8217;m interested in. I get to see the updates on the particular WebSlice. Whenever the slice content is updated the title of the slice on the favorites bar turns to bold.</p>
<p>The HTML that is displayed in the WebSlices details view comes from the description property of a WebSlice, which is set by the developer during design. The preview window has limited ability though; for example, the window allows no scripting or form controls.</p>
<p><strong>Creating your own WebSlices:</strong><br />
You just have to wrap whatever content that you want to become a WebSlice in a div tag, and set the class name for the div as &#8216;hslice&#8217;.</p>
<p>There are a few sub elements that you can use to further define the WebSlice: ‘entry-title’, ‘entry-content’ and &#8216;ttl&#8217; … among others.</p>

<div class="wp_codebox"><table><tr id="p846"><td class="code" id="p84code6"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;1&quot; class=&quot;hslice&quot;&gt;
&lt;p class=&quot;entry-title&quot;&gt;Item - $80.00&lt;/p&gt;
&nbsp;
&lt;div class=&quot;entry-content&quot;&gt;high bidder: buyer9 …&lt;/div&gt;
&lt;/div&gt;</pre></td></tr></table></div>

<p><strong>Conclusion:</strong><br />
At first it looked a little unremarkable but after trying some examples myself I think it could be a neat feature to add to your web pages.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codediesel.com/microsoft/ie8-webslices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

