<?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>Juliana Peña &#187; Chrome</title>
	<atom:link href="http://julianapena.com/category/chrome/feed/" rel="self" type="application/rss+xml" />
	<link>http://julianapena.com</link>
	<description></description>
	<lastBuildDate>Sun, 18 Sep 2011 09:34:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>C&#243;mo crear una extensi&#243;n de Chrome</title>
		<link>http://julianapena.com/2010/04/cmo-crear-una-extensin-para-chrome/</link>
		<comments>http://julianapena.com/2010/04/cmo-crear-una-extensin-para-chrome/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 20:33:02 +0000</pubDate>
		<dc:creator>Juliana Peña</dc:creator>
				<category><![CDATA[Chrome]]></category>
		<category><![CDATA[En Español]]></category>
		<category><![CDATA[español]]></category>
		<category><![CDATA[extension]]></category>

		<guid isPermaLink="false">http://julianapena.com/2010/04/cmo-crear-una-extensin-para-chrome/</guid>
		<description><![CDATA[Les comparto una presentación de cómo hacer una extensión para Chrome. Esta presentación la usé para un taller que di originalmente en el Día ISC del Tec CEM el 7 de abril de 2010 y luego de nuevo en FLISoL Toluca el 24 de abril de 2010. Puedes descargar los assets del taller, incluyendo la <a href="http://julianapena.com/2010/04/cmo-crear-una-extensin-para-chrome/"> read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Les comparto una presentación de cómo hacer una extensión para Chrome. Esta presentación la usé para un taller que di originalmente en el <a href="http://www.facebook.com/event.php?eid=103506059685589">Día ISC</a> del <a href="http://www.cem.itesm.mx">Tec CEM</a> el 7 de abril de 2010 y luego de nuevo en <a href="http://flisoltoluca.org/FLISOL2010/">FLISoL Toluca</a> el 24 de abril de 2010.</p>
<p align="center"><iframe height="342" src="http://docs.google.com/present/embed?id=dfc8gvz5_276fv83xjcr" frameborder="0" width="410"></iframe></p>
<p>Puedes <a href="http://julianapena.com/tallerchrome.zip">descargar los assets del taller</a>, incluyendo la versión PPTX de la presentación y todo el código separado en versiones. El producto final del taller, una extensión de lista de tareas, lo puedes encontrar en la <a href="https://chrome.google.com/extensions/detail/hmdeabhncokcbdkmjmmlojmcmogckdlh">Galería de Extensiones</a>. El código del taller está bajo el <a href="http://creativecommons.org/licenses/GPL/2.0/">GPLv2</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://julianapena.com/2010/04/cmo-crear-una-extensin-para-chrome/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Presentaci&#243;n: Extensiones de Chrome</title>
		<link>http://julianapena.com/2010/03/presentacin-extensiones-de-chrome/</link>
		<comments>http://julianapena.com/2010/03/presentacin-extensiones-de-chrome/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 04:05:25 +0000</pubDate>
		<dc:creator>Juliana Peña</dc:creator>
				<category><![CDATA[Chrome]]></category>
		<category><![CDATA[En Español]]></category>
		<category><![CDATA[español]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[slides]]></category>

		<guid isPermaLink="false">http://julianapena.com/2010/03/presentacin-extensiones-de-chrome/</guid>
		<description><![CDATA[Aquí está la presentación que di este sábado en la reunión del Google Technology Users Group (GTUG) de México.]]></description>
			<content:encoded><![CDATA[<p>Aquí está la presentación que di este sábado en la reunión del <a href="http://blog.gtug-mexicocity.org/">Google Technology Users Group (GTUG) de México</a>.</p>
<p align="center"><iframe height="342" src="http://docs.google.com/present/embed?id=dfc8gvz5_265t9tj55ft" frameborder="0" width="410"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://julianapena.com/2010/03/presentacin-extensiones-de-chrome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New versions of Postponer and ChromeMilk released</title>
		<link>http://julianapena.com/2010/03/new-versions-of-postponer-and-chromemilk-released/</link>
		<comments>http://julianapena.com/2010/03/new-versions-of-postponer-and-chromemilk-released/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 01:23:01 +0000</pubDate>
		<dc:creator>Juliana Peña</dc:creator>
				<category><![CDATA[Chrome]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://julianapena.com/2010/03/new-versions-of-postponer-and-chromemilk-released/</guid>
		<description><![CDATA[I’ve released new versions of my Chrome extensions Postponer and ChromeMilk. Postponer 0.4 add a one-click add mode to Adder and customizable popup size to Manager, as well as a few bug fixes. ChromeMilk 0.9.6 features a brand new icon as well as numerous bug fixes. As always, you can get them from the Chrome <a href="http://julianapena.com/2010/03/new-versions-of-postponer-and-chromemilk-released/"> read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://julianapena.com/wp-content/uploads/NewversionsofPostponerandChromeMilkrelea_11090/screengmail.png"><img style="display: inline; margin-left: 0px; margin-right: 0px; border: 0px;" title="screen-gmail" src="http://julianapena.com/wp-content/uploads/NewversionsofPostponerandChromeMilkrelea_11090/screengmail_thumb.png" border="0" alt="screen-gmail" width="225" height="235" align="right" /></a>I’ve released new versions of my Chrome extensions <a href="http://julianapena.com/projects/chrome-postponer/">Postponer</a> and <a href="http://julianapena.com/projects/chrome-rtm/">ChromeMilk</a>.</p>
<p>Postponer 0.4 add a one-click add mode to Adder and customizable popup size to Manager, as well as a few bug fixes.</p>
<p>ChromeMilk 0.9.6 features a brand new icon as well as numerous bug fixes.</p>
<p>As always, you can get them from the Chrome extensions gallery:</p>
<p><a href="https://chrome.google.com/extensions/detail/pggmlienkcoenodbjpkbidlmmedgonai">Postponer Adder</a></p>
<p><a href="https://chrome.google.com/extensions/detail/mmfblgljgoaokhbcjnddgcnaielcpjeb">Postponer Manager</a></p>
<p><a href="https://chrome.google.com/extensions/detail/chieodlkhimccchlojdmiondhiggkhmf">ChromeMilk</a></p>
<p>Thanks to everyone that reported bugs, and a special thanks to <a href="http://aconitehikaru.deviantart.com/">Camila González</a> for the new icon in ChromeMilk.</p>
<p>Please let me know of any bugs, issues, feature requests or just general comments you may have. Enjoy the extensions!</p>
]]></content:encoded>
			<wfw:commentRss>http://julianapena.com/2010/03/new-versions-of-postponer-and-chromemilk-released/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>New version of Postponer, now with Google Reader integration!</title>
		<link>http://julianapena.com/2010/02/new-version-of-postponer-now-with-google-reader-integration/</link>
		<comments>http://julianapena.com/2010/02/new-version-of-postponer-now-with-google-reader-integration/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 04:05:30 +0000</pubDate>
		<dc:creator>Juliana Peña</dc:creator>
				<category><![CDATA[Chrome]]></category>
		<category><![CDATA[extension]]></category>

		<guid isPermaLink="false">http://julianapena.com/2010/02/new-version-of-postponer-now-with-google-reader-integration/</guid>
		<description><![CDATA[I’ve released a new version of Postponer, my Google Chrome extensions for managing your Read It Later reading list. The best new feature is Google Reader integration. Now an icon will appear next to article titles so you can add the article directly to your reading list, similar to the official Firefox extension. The Google <a href="http://julianapena.com/2010/02/new-version-of-postponer-now-with-google-reader-integration/"> read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://julianapena.com/wp-content/uploads/NewversionofPostponernowwithGoogleReader_94CF/PostponerAdderGreaderScreen.png"><img style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" title="PostponerAdderGreaderScreen" src="http://julianapena.com/wp-content/uploads/NewversionofPostponernowwithGoogleReader_94CF/PostponerAdderGreaderScreen_thumb.png" border="0" alt="PostponerAdderGreaderScreen" width="495" height="248" /></a></p>
<p>I’ve released a new version of <a href="http://julianapena.com/projects/chrome-postponer/">Postponer</a>, my <a href="http://www.google.com/chrome">Google Chrome</a> extensions for managing your <a href="http://readitlaterlist.com/">Read It Later</a> reading list. The best new feature is <a href="http://www.google.com/reader">Google Reader</a> integration. Now an icon will appear next to article titles so you can add the article directly to your reading list, similar to the <a href="http://readitlaterlist.com/firefox/">official Firefox extension</a>.</p>
<p>The Google Reader icon is fully customizable and you can modify its behavior in the new Postponer Adder options page.</p>
<p>You can get Postponer at its <a href="http://julianapena.com/projects/chrome-postponer/">project page</a>. As always, feedback is well received; if you find a bug or want a new feature, please <a href="http://code.google.com/p/chromepostponer/issues/entry">report it</a>.</p>
<p><a href="http://julianapena.com/wp-content/uploads/NewversionofPostponernowwithGoogleReader_94CF/image.png"><img style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" title="image" src="http://julianapena.com/wp-content/uploads/NewversionofPostponernowwithGoogleReader_94CF/image_thumb.png" border="0" alt="image" width="476" height="325" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://julianapena.com/2010/02/new-version-of-postponer-now-with-google-reader-integration/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Help me translate ChromeMilk and Postponer</title>
		<link>http://julianapena.com/2010/02/help-me-translate-chromemilk-and-postponer/</link>
		<comments>http://julianapena.com/2010/02/help-me-translate-chromemilk-and-postponer/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 01:20:20 +0000</pubDate>
		<dc:creator>Juliana Peña</dc:creator>
				<category><![CDATA[Chrome]]></category>
		<category><![CDATA[extension]]></category>

		<guid isPermaLink="false">http://julianapena.com/?p=420</guid>
		<description><![CDATA[&#160;Image by Beekman Google has sent me an email asking me to translate my extensions using the new Chrome Extensions i18n API. I’m only fluent in English and Spanish, but I want the whole world to enjoy my extensions. If you know any of the languages supported by Chrome and would like to help me <a href="http://julianapena.com/2010/02/help-me-translate-chromemilk-and-postponer/"> read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://julianapena.com/wp-content/uploads/HelpmetranslateChromeMilkandPostponer_10FE4/image.png"><img style="border-right-width: 0px; display: block; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="Internationalization" border="0" alt="Internationalization" src="http://julianapena.com/wp-content/uploads/HelpmetranslateChromeMilkandPostponer_10FE4/image_thumb.png" width="401" height="264" /></a></p>
<p align="center">&#160;<em><a href="http://www.flickr.com/photos/un_photo/3311542781/">Image by Beekman</a></em></p>
<p>Google has sent me an email asking me to translate my extensions using the new <a href="http://code.google.com/chrome/extensions/i18n.html">Chrome Extensions i18n API</a>. I’m only fluent in English and Spanish, but I want the whole world to enjoy my extensions. If you know any of the languages supported by Chrome and would like to help me translate, please let me know. You can read the documentation and take a look at the source code for <a href="http://code.google.com/p/chromemilk/source/browse/">ChromeMilk</a> and <a href="http://code.google.com/p/chromepostponer/source/browse/">Postponer</a>. I’ll be providing two translations (English and Spanish) soon.</p>
<h3></h3>
<h4>Update</h4>
<p>I’ve set up wiki pages for <a href="http://code.google.com/p/chromemilk/wiki/i18nContacts">ChromeMilk</a> and <a href="http://code.google.com/p/chromepostponer/wiki/i18nContacts">Postponer</a> with the links to the people who have volunteered to translate.</p>
]]></content:encoded>
			<wfw:commentRss>http://julianapena.com/2010/02/help-me-translate-chromemilk-and-postponer/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to build a Chrome extension, Part 4: Background pages and scheduling requests</title>
		<link>http://julianapena.com/2010/01/how-to-build-a-chrome-extension-part-4-background-pages-and-scheduling-requests/</link>
		<comments>http://julianapena.com/2010/01/how-to-build-a-chrome-extension-part-4-background-pages-and-scheduling-requests/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 03:45:24 +0000</pubDate>
		<dc:creator>Juliana Peña</dc:creator>
				<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[extension]]></category>

		<guid isPermaLink="false">http://julianapena.com/?p=409</guid>
		<description><![CDATA[One of the most common uses for an extension is as a notifier. For example, the Google Gmail Checker, an official Google extension and the most popular one in the gallery, constantly checks your Gmail inbox for new unread mail. This functionality is easy to add into your own extension. You need to add a <a href="http://julianapena.com/2010/01/how-to-build-a-chrome-extension-part-4-background-pages-and-scheduling-requests/"> read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One of the most common uses for an extension is as a notifier. For example, the <a href="https://chrome.google.com/extensions/detail/mihcahmgecmbnbcchbopgniflfhgnkff">Google Gmail Checker</a>, an official Google extension and the most popular one in the gallery, constantly checks your Gmail inbox for new unread mail.</p>
<p>This functionality is easy to add into your own extension. You need to add a background page, which is easily added by adding the background_page option to your manifest.json:</p>
<div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:08cde715-f4bd-49b2-a7d2-ad7ff4ca5738" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;">
<pre class="brush: javascript;">{
	"name": "My Extension",
	...
	"background_page": "background.html",
	...
}</pre>
</div>
<p>Like almost every other component in a Chrome extension, background.html is a standard HTML file. However, it can also do things most web pages cannot, such as <a href="http://code.google.com/chrome/extensions/xhr.html">cross-origin requests</a> if permissions are correctly added to the manifest. For example, if your extension is a Gmail checker, it would need permissions to <a href="http://www.google.com">http://www.google.com</a> and <a href="https://www.google.com">https://www.google.com</a>. To add these permissions, the manifest.json would be edited to:</p>
<div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:babaf12b-186f-4c66-a12c-a6ae946caef4" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;">
<pre class="brush: javascript;">{
	"name": "My Extension",
	...
	"background_page": "background.html",
	"permissions": ["http://www.google.com/", "https://www.google.com/"],
	...
}</pre>
</div>
<p>A background page runs at all times when the extension is enabled. You cannot see it, but it can modify other aspects of the extension, like setting the browser action badge. For example, the following example would set the icon badge to the number of unread items in a hypothetical service:</p>
<div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:44a4f7d6-b513-4ff9-9f16-df573150bdc6" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;">
<pre class="brush: javascript;">function getUnreadItems(callback) {
	$.ajax(..., function(data) {
		process(data);
		callback(data);
	});
}

function updateBadge() {
	getUnreadItems(function(data) {
		chrome.browserAction.setBadgeText({text:data.unreadItems});
	});
}</pre>
</div>
<p>So now you can make a request, but how can you schedule it so the data is retrieved and processed regularly? Luckily, JavaScript has a method called window.setTimeout to do just that:</p>
<div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:1b5ebf9b-6c9c-428e-96ef-deb92b76b987" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;">
<pre class="brush: javascript;">var pollInterval = 1000 * 60; // 1 minute, in milliseconds

function startRequest() {
	updateBadge();
	window.setTimeout(startRequest, pollInterval);
}</pre>
</div>
<p>That was easy! Now just slap a</p>
<pre class="brush: html">onload='startRequest()'</pre>
<p>on the background page’s body tag and that should do it!</p>
<p>But what if you want to stop the request? That can easily be done as well, by chaging the startRequest function a little and adding a stopRequest function:</p>
<div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:b44225b5-3eb1-438d-a29f-0c02c893b8c7" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;">
<pre class="brush: javascript;">var pollInterval = 1000 * 60; // 1 minute, in milliseconds
var timerId;

function startRequest() {
	updateBadge();
	timerId = window.setTimeout(startRequest, pollInterval);
}

function stopRequest() {
	window.clearTimeout(timerId);
}</pre>
</div>
<p>And that’s about it on building background pages that can schedule requests. Now go! Make an awesome notifier! You can even make things like a timer with this (Facebook addiction control, anyone?). Just remember to leave a comment telling everyone of your awesomeness.</p>
]]></content:encoded>
			<wfw:commentRss>http://julianapena.com/2010/01/how-to-build-a-chrome-extension-part-4-background-pages-and-scheduling-requests/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>How to build a Chrome extension, Part 3: Loading any web page in a popup</title>
		<link>http://julianapena.com/2010/01/how-to-build-a-chrome-extension-part-3-loading-any-web-page-in-a-popup/</link>
		<comments>http://julianapena.com/2010/01/how-to-build-a-chrome-extension-part-3-loading-any-web-page-in-a-popup/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 03:40:18 +0000</pubDate>
		<dc:creator>Juliana Peña</dc:creator>
				<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[extension]]></category>

		<guid isPermaLink="false">http://julianapena.com/2010/01/how-to-build-a-chrome-extension-part-3-loading-any-web-page-in-a-popup/</guid>
		<description><![CDATA[Chrome allows extensions that use its page action or browser action API to show popups when clicked. To add this popup, you’d add a popup.html file to your extension and the following to the manifest.json for browser actions: { "name": "My Extension", ... "browser_action": { "default_icon": "myicon.png", "popup": "popup.html" } ... } Or for page <a href="http://julianapena.com/2010/01/how-to-build-a-chrome-extension-part-3-loading-any-web-page-in-a-popup/"> read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Chrome allows extensions that use its <a href="http://code.google.com/chrome/extensions/pageAction.html">page action</a> or <a href="http://code.google.com/chrome/extensions/browserAction.html">browser action</a> API to show popups when clicked. To add this popup, you’d add a popup.html file to your extension and the following to the manifest.json for browser actions:</p>
<pre class="brush: js">{
	"name": "My Extension",
	...
	"browser_action": {
		"default_icon": "myicon.png",
		"popup": "popup.html"
	}
	...
}</pre>
<p>Or for page actions:</p>
<pre class="brush: js">{
	"name": "My Extension",
	...
	"page_action": {
		"default_icon": "myicon.png",
		"popup": "popup.html"
	}
	...
}</pre>
<p>However, the popup page is static and cannot be changed while the extension is running. Also, only a local extension page can be put into a popup; you can’t load an external page.</p>
<p>So how can you fix this? Using a relatively old web technique called an iframe. Inline frame, or iframe, is an HTML element that can load any web page inside another in a type of box. So, even though you can’t load an external web page as your popup, you can load it <em>within</em> it.</p>
<p>A simple example for a Bing search extension would be:</p>
<div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:a5285258-32cb-435a-8157-9dbedd4ca7ff" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;">
<pre class="brush: xml;">&lt;html&gt;
&lt;head&gt;
	&lt;style type="text/css"&gt;
	body {width:200; height:300;}
	&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
	&lt;iframe src="http://m.bing.com" width="100%" height="100%" frameborder="0"&gt;
	&lt;/iframe&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
</div>
<p>As you can see, I have loaded the mobile version of Bing, <a title="http://m.bing.com" href="http://m.bing.com">http://m.bing.com</a>. Because of the small amount of screen real estate available on the popups, loading mobile versions of a page is a good idea as they are minimalistic and require less space.</p>
<p>I’ve also explicitly declared the size of the page (200 by 300) and the iframe (100% of the page). You can change this to what fits your extension best.</p>
<p>(Yeah, I know it is ironic to build a Chrome extension centered on Bing, but I couldn’t get <a href="http://www.google.com/m">Google’s mobile search</a> to load correctly in an iframe.)</p>
<p>On Chrome, the Bing search extension would look like this:</p>
<p><a href="http://julianapena.com/wp-content/uploads/HowtobuildaChromeextensionPart3Loadingan_13EA3/image.png"><img style="margin: 0px auto 5px; display: block; float: none; border-width: 0px;" title="image" src="http://julianapena.com/wp-content/uploads/HowtobuildaChromeextensionPart3Loadingan_13EA3/image_thumb.png" border="0" alt="image" width="390" height="367" /></a></p>
<p>You can download the completed Bing extension from the <a href="https://chrome.google.com/extensions/detail/dkjkkandkknagonejgliebkekfkkofad">Chrome Extensions Gallery</a> and the source code (under the <a href="http://creativecommons.org/licenses/GPL/2.0/">GPLv2</a>) from <a href="http://mfi.re/?imwxngtdkhg">Mediafire</a>.</p>
<p>Now, what if you want to load a different page depending on an <a href="http://julianapena.com/2010/01/how-to-build-a-chrome-extension-part-2-options-and-localstorage/">extension option</a>? You can easily do this by constructing the iframe element dynamically when the page loads, like this code excerpt from <a href="http://julianapena.com/projects/chrome-rtm/">ChromeMilk</a>:</p>
<div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:dc0221eb-6196-4a17-96b4-eb1d29d48b94" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;">
<pre class="brush: javascript;">$(document).ready(function() {
	var popup = localStorage.popup || 'igoogle';

	var frame = document.createElement('iframe');

	frame.setAttribute('width', '100%');
	frame.setAttribute('height', '100%');
	frame.setAttribute('frameborder', '0');
	frame.setAttribute('id', 'rtmframe');

	if (popup == 'gmail') {
		// open gmail gadget
		$('body').height(300).width(200);
		frame.setAttribute('src', 'http://www.rememberthemilk.com/services/modules/gmail/');
	}
	else if (popup == 'iphone') {
		// open iphone web app
		$('body').height(480).width(320);
		frame.setAttribute('src', 'http://i.rememberthemilk.com/');
	}
	else if (popup == 'mobile') {
		// open mobile web app
		$('body').height(300).width(200);
		frame.setAttribute('src', 'http://m.rememberthemilk.com/');
	}
	else {
		// igoogle and default
		$('body').height(400).width(400);
		frame.setAttribute('src', 'http://www.rememberthemilk.com/services/modules/googleig/');
	}

	document.body.appendChild(frame);
});</pre>
</div>
<p>This way, the extension sets the popup size and the iframe location based on a setting saved by the user.</p>
<p>There are a few limitations of this method. Most importantly, you can’t manipulate the iframe once it is loaded, as this is <a href="http://en.wikipedia.org/wiki/Cross-site_scripting">cross-side scripting</a> and is prevented by the browser for security reasons.</p>
<p>That’s about it on loading external web sites in popups. You can use this for a number of things. I’ve mentioned mobile sites, but things like iGoogle widgets also work well.</p>
<p>Do you have any tips on building Chrome extensions based on popups? Or are you having trouble building your extension? Leave a comment!</p>
]]></content:encoded>
			<wfw:commentRss>http://julianapena.com/2010/01/how-to-build-a-chrome-extension-part-3-loading-any-web-page-in-a-popup/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>How to build a Chrome extension, Part 2: Options and localStorage</title>
		<link>http://julianapena.com/2010/01/how-to-build-a-chrome-extension-part-2-options-and-localstorage/</link>
		<comments>http://julianapena.com/2010/01/how-to-build-a-chrome-extension-part-2-options-and-localstorage/#comments</comments>
		<pubDate>Sun, 03 Jan 2010 20:57:39 +0000</pubDate>
		<dc:creator>Juliana Peña</dc:creator>
				<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[extension]]></category>

		<guid isPermaLink="false">http://julianapena.com/?p=399</guid>
		<description><![CDATA[An important aspect of almost all extensions is being able to save user settings. This can be achieved in Chrome easily by using the localStorage object and Chrome’s extension API options page. Adding an options page To add an options page to your extension, make an options.html file in your extension’s folder and add the <a href="http://julianapena.com/2010/01/how-to-build-a-chrome-extension-part-2-options-and-localstorage/"> read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>An important aspect of almost all extensions is being able to save user settings. This can be achieved in Chrome easily by using the localStorage object and Chrome’s extension API options page.</p>
<h3>Adding an options page</h3>
<p>To add an options page to your extension, make an options.html file in your extension’s folder and add the “options_page” line to your manifest.json like so:</p>
<pre class="brush: js">{
  "name": "My Extension",
  ...
  "options_page": "options.html"
  ...
}</pre>
<h3>localStorage</h3>
<p>localStorage is an HTML5 object used for storing web page data locally using JavaScript. Chrome gives extensions the option of using localStorage to save options and data.</p>
<h3>Saving options</h3>
<p>To save a string to localStorage, use the following code, replacing mysetting and myvalue with your own:</p>
<pre class="brush: js">localStorage["mysetting"] = "myvalue";</pre>
<p>Or, equivalently:</p>
<pre class="brush: js">localStorage.mysetting = "myvalue";</pre>
<h3>Loading options</h3>
<p>To load an option, just access the setting member in the localstorage object:</p>
<pre class="brush: js">myvar = localStorage["mysetting"];</pre>
<p>Or, equivalently:</p>
<pre class="brush: js">myvar = localStorage.mysetting;</pre>
<p>It’s always a good idea to make sure you’ve loaded a valid setting. For example, the following code loads a favorite color, but if the current color is not valid, it loads the default value:</p>
<pre class="brush: js">var defaultColor = "blue";

function loadFavColor() {
	var favColor = localStorage["favColor"];

	// valid colors are red, blue, green and yellow
	if (favColor == undefined || (favColor != "red" &amp;&amp; favColor != "blue" &amp;&amp; favColor != "green" &amp;&amp; favColor != "yellow")) {
		favColor = defaultColor;
	}

	return favColor;
}</pre>
<h3>Erasing options</h3>
<p>You can erase an option by removing it from the localstorage object, like so:</p>
<pre class="brush: js">localStorage.removeItem("mysetting");</pre>
<h3>Building an options page</h3>
<p>Continuing with the favorite color example, lets now build a complete options page for our color-choosing extension. The options.html page would look like this:</p>
<pre class="brush: xml;">&lt;html&gt;
&lt;head&gt;
	&lt;title&gt;Options for Color Chooser&lt;/title&gt;
	&lt;script type="text/javascript" src="options.js"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body onload="loadOptions()"&gt;
	&lt;h1&gt;Favorite Color&lt;/h1&gt;
	&lt;select id="color"&gt;
		&lt;option value="blue"&gt;Blue&lt;/option&gt;
		&lt;option value="red"&gt;Red&lt;/option&gt;
		&lt;option value="green"&gt;Green&lt;/option&gt;
		&lt;option value="yellow"&gt;Yellow&lt;/option&gt;
	&lt;/select&gt;
	&lt;br /&gt;
	&lt;button onclick="saveOptions()"&gt;Save&lt;/button&gt;
	&lt;br /&gt;
	&lt;button onclick="eraseOptions()"&gt;Restore default&lt;/button&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>For the behavior of the page, options.js would look like this:</p>
<pre class="brush: javascript;">var defaultColor = "blue";

function loadOptions() {
	var favColor = localStorage["favColor"];

	// valid colors are red, blue, green and yellow
	if (favColor == undefined || (favColor != "red" &amp;&amp; favColor != "blue" &amp;&amp; favColor != "green" &amp;&amp; favColor != "yellow")) {
		favColor = defaultColor;
	}

	var select = document.getElementById("color");
	for (var i = 0; i &lt; select.children.length; i++) {
		var child = select.children[i];
			if (child.value == favColor) {
			child.selected = "true";
			break;
		}
	}
}

function saveOptions() {
	var select = document.getElementById("color");
	var color = select.children[select.selectedIndex].value;
	localStorage["favColor"] = color;
}

function eraseOptions() {
	localStorage.removeItem("favColor");
	location.reload();
}</pre>
<p>And that’s about it! You can also save and load localStorage data elsewhere in your extension, as the data is shared between all your extension’s files.</p>
<p>Any question, remark, or addition? Please leave a comment!</p>
]]></content:encoded>
			<wfw:commentRss>http://julianapena.com/2010/01/how-to-build-a-chrome-extension-part-2-options-and-localstorage/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>How to build a Chrome extension, Part 1: Basics</title>
		<link>http://julianapena.com/2010/01/how-to-build-a-chrome-extension-part-1-basics/</link>
		<comments>http://julianapena.com/2010/01/how-to-build-a-chrome-extension-part-1-basics/#comments</comments>
		<pubDate>Sun, 03 Jan 2010 17:21:08 +0000</pubDate>
		<dc:creator>Juliana Peña</dc:creator>
				<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[extension]]></category>

		<guid isPermaLink="false">http://julianapena.com/2010/01/how-to-build-a-chrome-extension-part-1-basics/</guid>
		<description><![CDATA[Building Chrome extensions is super-easy. I’ve already made two: ChromeMilk and Postponer. I wanted so share my method of building extensions, so I’m going to write a series of posts. This one will cover the basics on how to set up a good development environment and how to begin writing the extensions. 1. Install Chrome <a href="http://julianapena.com/2010/01/how-to-build-a-chrome-extension-part-1-basics/"> read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://julianapena.com/wp-content/uploads/HowtobuildaChromeextensionPart1Basics_ADA5/image.png"><img style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" title="image" src="http://julianapena.com/wp-content/uploads/HowtobuildaChromeextensionPart1Basics_ADA5/image_thumb.png" border="0" alt="image" width="442" height="353" /></a></p>
<p>Building Chrome extensions is super-easy. I’ve already made two: <a href="http://julianapena.com/projects/chrome-rtm/">ChromeMilk</a> and <a href="http://julianapena.com/projects/chrome-postponer/">Postponer</a>. I wanted so share my method of building extensions, so I’m going to write a series of posts. This one will cover the basics on how to set up a good development environment and how to begin writing the extensions.</p>
<h3>1. Install Chrome dev channel</h3>
<p>The <a href="http://dev.chromium.org/getting-involved/dev-channel">Chrome dev channel</a> has the latest technologies and the best developing tools. <a href="http://www.google.com/chrome/eula.html?extra=devchannel">Install it</a> and use it to debug extensions.</p>
<h3>2. Get a text editor to write the code in</h3>
<p>If you’re really Spartan you can use regular Notepad. I use <a href="http://www.flos-freeware.ch/notepad2.html">Notepad2</a> because it’s light but has syntax highlighting and other features. There are many available, so take your pick.</p>
<h3>3. Learn HTML, CSS and JavaScript</h3>
<p>Chrome extensions are made using the same techniques used to make web pages. HTML for content, CSS for presentation and JavaScript for behavior and interaction. I highly recommend the tutorials at <a href="http://w3schools.com/">W3Schools</a> if you are just starting out. If you’ve been building web pages for a while, you can probably skip this step.</p>
<h3>4. Follow the official Getting Started tutorial</h3>
<p>Google has a <a href="http://code.google.com/chrome/extensions/getstarted.html">very good tutorial for writing your first extension</a>. This tutorial shows you how to build a simple extension and test in on your browser. After this, you should be ready to build your own extension!</p>
<h3>5. Now what?</h3>
<p>Now that you know how to build a basic Chrome extension, it’s time to let your imagination run wild! Read the <a href="http://code.google.com/chrome/extensions/devguide.html">extension documentation</a> and see what you can build with it. Start small and don’t be afraid to be wrong. When your extension is ready, you can submit it to the <a href="https://chrome.google.com/extensions/">Chrome Extensions Gallery</a> so that everyone can use it!</p>
<p>I’ll be writing more posts on this, so stay tuned.</p>
<p>Do you have any tips for building Chrome extensions? Have your made an extension after following these steps? What other resources do you use to make extensions? Leave a comment and tell us all about it!</p>
]]></content:encoded>
			<wfw:commentRss>http://julianapena.com/2010/01/how-to-build-a-chrome-extension-part-1-basics/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>New Project: Postponer, Read It Later extensions for Google Chrome</title>
		<link>http://julianapena.com/2010/01/new-project-postponer-read-it-later-extensions-for-google-chrome/</link>
		<comments>http://julianapena.com/2010/01/new-project-postponer-read-it-later-extensions-for-google-chrome/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 09:41:36 +0000</pubDate>
		<dc:creator>Juliana Peña</dc:creator>
				<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://julianapena.com/?p=392</guid>
		<description><![CDATA[I’ve published a new project on my Projects page: Postponer. Postponer is a pair of Chrome extensions to manage your Read It Later items. You can read more about Postponer and download it on its project page.]]></description>
			<content:encoded><![CDATA[<p><a href="http://julianapena.com/wp-content/uploads/NewProjectPostponerReadItLaterextensions_41EF/PostponerManagerScreen.png"><img style="margin: 0px 15px 0px 0px; display: inline;" title="PostponerManagerScreen" src="http://julianapena.com/wp-content/uploads/NewProjectPostponerReadItLaterextensions_41EF/PostponerManagerScreen_thumb.png" alt="PostponerManagerScreen" width="240" height="212" align="left" /></a>I’ve published a new project on my <a href="http://julianapena.com/projects/">Projects page</a>: <a href="http://julianapena.com/projects/chrome-postponer/">Postponer</a>.</p>
<p>Postponer is a pair of Chrome extensions to manage your Read It Later items.</p>
<p>You can read more about Postponer and download it on its <a href="http://julianapena.com/projects/chrome-postponer/">project page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://julianapena.com/2010/01/new-project-postponer-read-it-later-extensions-for-google-chrome/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
