<?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/tag/chrome/feed/" rel="self" type="application/rss+xml" />
	<link>http://julianapena.com</link>
	<description>Musings of a computer science student</description>
	<lastBuildDate>Thu, 01 Jul 2010 20:50:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<atom:link rel='hub' href='http://julianapena.com/?pushpress=hub'/>
		<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 versión <a href="http://julianapena.com/2010/04/cmo-crear-una-extensin-para-chrome/" class="more-link">More &#62;</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>4</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 extensions gallery:
Postponer Adder
Postponer <a href="http://julianapena.com/2010/03/new-versions-of-postponer-and-chromemilk-released/" class="more-link">More &#62;</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>3</slash:comments>
		</item>
		<item>
		<title>What is a browser?</title>
		<link>http://julianapena.com/2010/03/what-is-a-browser/</link>
		<comments>http://julianapena.com/2010/03/what-is-a-browser/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 17:18:32 +0000</pubDate>
		<dc:creator>Juliana Peña</dc:creator>
				<category><![CDATA[Tech issues]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[firefox]]></category>

		<guid isPermaLink="false">http://julianapena.com/2010/03/what-is-a-browser/</guid>
		<description><![CDATA[I just remembered this video today. It’s a great look at what people think a browser is. It’s incredible how many people confuse a browser with a search engine.

Now that the browser ballot has come into effect in the EU, will this lead people to be more educated about what a browser is? The browser <a href="http://julianapena.com/2010/03/what-is-a-browser/" class="more-link">More &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>I just remembered this video today. It’s a great look at what people think a browser is. It’s incredible how many people confuse a browser with a search engine.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="wmode" value="transparent" /><param name="src" value="http://www.youtube.com/v/o4MwTvtyrUQ&amp;hl=en_US&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="640" height="385" src="http://www.youtube.com/v/o4MwTvtyrUQ&amp;hl=en_US&amp;fs=1&amp;" wmode="transparent" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Now that the <a href="http://www.browserchoice.eu/BrowserChoice/browserchoice_en.htm">browser ballot</a> has come into effect in the EU, will this lead people to be more educated about what a browser is? The browser ballot page has no information as to what a browser is and what it is for. As the video shows, many people are ignorant on the subject. Choosing a good browser is not something easy for those that have no idea what this is.</p>
<p>What would you do to increase awareness on web browsers and other important Internet technologies most users ignore?</p>
]]></content:encoded>
			<wfw:commentRss>http://julianapena.com/2010/03/what-is-a-browser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Opera Rant</title>
		<link>http://julianapena.com/2010/03/my-opera-rant/</link>
		<comments>http://julianapena.com/2010/03/my-opera-rant/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 20:28:11 +0000</pubDate>
		<dc:creator>Juliana Peña</dc:creator>
				<category><![CDATA[Tech issues]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[opera]]></category>
		<category><![CDATA[web browser]]></category>

		<guid isPermaLink="false">http://julianapena.com/2010/03/my-opera-rant/</guid>
		<description><![CDATA[
Oh, Opera&#8230; You are the browser that standardized tabbed browsing, new tab pages, browser synching, and so many more innovative features. You are one of the fastest and most standards-compliant browsers. You are the browser that pushes development of other browsers forward. Yet you can barely break 2% market adoption. Why is that? Why, for <a href="http://julianapena.com/2010/03/my-opera-rant/" class="more-link">More &#62;</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://julianapena.com/wp-content/uploads/MyOperaRant_CB69/image.png"><img style="display: block; float: none; margin-left: auto; margin-right: auto; border: 0px;" title="image" src="http://julianapena.com/wp-content/uploads/MyOperaRant_CB69/image_thumb.png" border="0" alt="image" width="352" height="242" /></a></p>
<p>Oh, Opera&#8230; You are the browser that standardized tabbed browsing, new tab pages, browser synching, and so many more innovative features. You are one of the fastest and most standards-compliant browsers. You are the browser that pushes development of other browsers forward. Yet you can barely break 2% market adoption. Why is that? Why, for a browser first launched 8 years before Firefox and only one year after Internet Explorer?</p>
<p>Opera, you don&#8217;t need to sue Microsoft to gain market share. Firefox, a browser just 6 years old, has reached 20+%. Chrome, which is less than two years old, is pushing on 6%. You might say, &#8220;But Google has funds for marketing!&#8221; But what about Mozilla? Firefox is the second largest browser, and it is made and managed by a company a third of the size of Opera Software.</p>
<p>Opera, your desktop business model doesn&#8217;t work. If you need the EU to force users into changing browsers so you can gain market share, you&#8217;re doing it wrong. You need to expand your user base not only by creating great new features, which you do all the time, but also by <strong>advertising</strong> them. Your main weakness, Opera, is that nobody knows about you.</p>
<p>On its launch day, Firefox posted a full-page ad in the New York Times. Both Chrome and Firefox have launched TV and viral ad campaigns like Spread Firefox and Firefox Flicks. Google has advertised Chrome in its most prominent products like YouTube.</p>
<p>Firefox arrived at a time when everybody was starting to get sick of IE. You never took advantage of that. Chrome arrived at a time when everybody was starting to get sick of Firefox. You didn&#8217;t take advantage of that either. Yet, when the EU says that Microsoft has to do advertising for you, you quickly whip up a shiny new version and thank the EU for tripling your downloads.</p>
<p>I&#8217;m disappointed, Opera, that such a good browser has such a little market share because you refuse to do real advertising. Let&#8217;s hope this new surge is market share the browser ballot might bring will change the way you look at the market and your users.</p>
]]></content:encoded>
			<wfw:commentRss>http://julianapena.com/2010/03/my-opera-rant/feed/</wfw:commentRss>
		<slash:comments>3</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 Reader <a href="http://julianapena.com/2010/02/new-version-of-postponer-now-with-google-reader-integration/" class="more-link">More &#62;</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>2</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 translate, <a href="http://julianapena.com/2010/02/help-me-translate-chromemilk-and-postponer/" class="more-link">More &#62;</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>2</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 background <a href="http://julianapena.com/2010/01/how-to-build-a-chrome-extension-part-4-background-pages-and-scheduling-requests/" class="more-link">More &#62;</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>3</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 actions:
{
	"name": "My Extension",
	...
	"page_action": {
		"default_icon": "myicon.png",
		"popup": "popup.html"
	}
	...
}
However, the popup page is <a href="http://julianapena.com/2010/01/how-to-build-a-chrome-extension-part-3-loading-any-web-page-in-a-popup/" class="more-link">More &#62;</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>6</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 “options_page” line <a href="http://julianapena.com/2010/01/how-to-build-a-chrome-extension-part-2-options-and-localstorage/" class="more-link">More &#62;</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>11</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.472 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-07-24 02:25:24 -->
