<?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: getSelection() returns empty in Google Mail</title>
	<atom:link href="http://scottbarnham.com/blog/2008/02/21/getselection-returns-empty-in-google-mail/feed/" rel="self" type="application/rss+xml" />
	<link>http://scottbarnham.com/blog/2008/02/21/getselection-returns-empty-in-google-mail/</link>
	<description>Code and comments on web development, Django, Python and things (un)related.</description>
	<lastBuildDate>Fri, 03 Feb 2012 14:24:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: jason braswell</title>
		<link>http://scottbarnham.com/blog/2008/02/21/getselection-returns-empty-in-google-mail/comment-page-1/#comment-1055</link>
		<dc:creator>jason braswell</dc:creator>
		<pubDate>Thu, 11 Aug 2011 15:33:28 +0000</pubDate>
		<guid isPermaLink="false">http://scottbarnham.com/blog/2008/02/21/getselection-returns-empty-in-google-mail/#comment-1055</guid>
		<description>Thanks! This saved a newbie (me) a lot of time.</description>
		<content:encoded><![CDATA[<p>Thanks! This saved a newbie (me) a lot of time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Natch</title>
		<link>http://scottbarnham.com/blog/2008/02/21/getselection-returns-empty-in-google-mail/comment-page-1/#comment-797</link>
		<dc:creator>Natch</dc:creator>
		<pubDate>Tue, 15 Jun 2010 19:56:40 +0000</pubDate>
		<guid isPermaLink="false">http://scottbarnham.com/blog/2008/02/21/getselection-returns-empty-in-google-mail/#comment-797</guid>
		<description>top.document.activeElement.contentWindow.getSelection();

For some odd reason the activeElement is always an HTML Iframe element. This works for me in Gmail.


G&#039;luck.</description>
		<content:encoded><![CDATA[<p>top.document.activeElement.contentWindow.getSelection();</p>
<p>For some odd reason the activeElement is always an HTML Iframe element. This works for me in Gmail.</p>
<p>G&#8217;luck.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fraser</title>
		<link>http://scottbarnham.com/blog/2008/02/21/getselection-returns-empty-in-google-mail/comment-page-1/#comment-779</link>
		<dc:creator>Fraser</dc:creator>
		<pubDate>Tue, 16 Mar 2010 23:37:50 +0000</pubDate>
		<guid isPermaLink="false">http://scottbarnham.com/blog/2008/02/21/getselection-returns-empty-in-google-mail/#comment-779</guid>
		<description>Hi - I ran into the same problem in gmail with getSelection().  I think that it may be because gmail uses several frames - if you iterate over window.frames and call getSelection() on each one, you may find what you&#039;re looking for.</description>
		<content:encoded><![CDATA[<p>Hi &#8211; I ran into the same problem in gmail with getSelection().  I think that it may be because gmail uses several frames &#8211; if you iterate over window.frames and call getSelection() on each one, you may find what you&#8217;re looking for.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott</title>
		<link>http://scottbarnham.com/blog/2008/02/21/getselection-returns-empty-in-google-mail/comment-page-1/#comment-647</link>
		<dc:creator>Scott</dc:creator>
		<pubDate>Fri, 20 Mar 2009 03:21:39 +0000</pubDate>
		<guid isPermaLink="false">http://scottbarnham.com/blog/2008/02/21/getselection-returns-empty-in-google-mail/#comment-647</guid>
		<description>Hi Lenny.

You can call &lt;code&gt;window.content.getSelection()&lt;/code&gt; in a bookmarklet, but of course that won&#039;t work in Gmail.  It looks like &lt;code&gt;document.commandDispatcher&lt;/code&gt; is only available within &lt;code&gt;XUL&lt;/code&gt; (e.g. a Firefox extension), not for regular JavaScript in a web page or bookmarklet.

Sorry, I don&#039;t know of a workaround.</description>
		<content:encoded><![CDATA[<p>Hi Lenny.</p>
<p>You can call <code>window.content.getSelection()</code> in a bookmarklet, but of course that won&#8217;t work in Gmail.  It looks like <code>document.commandDispatcher</code> is only available within <code>XUL</code> (e.g. a Firefox extension), not for regular JavaScript in a web page or bookmarklet.</p>
<p>Sorry, I don&#8217;t know of a workaround.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lenny</title>
		<link>http://scottbarnham.com/blog/2008/02/21/getselection-returns-empty-in-google-mail/comment-page-1/#comment-646</link>
		<dc:creator>Lenny</dc:creator>
		<pubDate>Thu, 19 Mar 2009 23:05:16 +0000</pubDate>
		<guid isPermaLink="false">http://scottbarnham.com/blog/2008/02/21/getselection-returns-empty-in-google-mail/#comment-646</guid>
		<description>Hi Scott, I&#039;m not sure how to use this solution in a bookmarklet.
Is that possible?</description>
		<content:encoded><![CDATA[<p>Hi Scott, I&#8217;m not sure how to use this solution in a bookmarklet.<br />
Is that possible?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bernard</title>
		<link>http://scottbarnham.com/blog/2008/02/21/getselection-returns-empty-in-google-mail/comment-page-1/#comment-584</link>
		<dc:creator>Bernard</dc:creator>
		<pubDate>Wed, 19 Nov 2008 21:42:10 +0000</pubDate>
		<guid isPermaLink="false">http://scottbarnham.com/blog/2008/02/21/getselection-returns-empty-in-google-mail/#comment-584</guid>
		<description>Any ideas how to get selected text from gmail in Chrome?</description>
		<content:encoded><![CDATA[<p>Any ideas how to get selected text from gmail in Chrome?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gavin</title>
		<link>http://scottbarnham.com/blog/2008/02/21/getselection-returns-empty-in-google-mail/comment-page-1/#comment-554</link>
		<dc:creator>Gavin</dc:creator>
		<pubDate>Sat, 27 Sep 2008 21:14:58 +0000</pubDate>
		<guid isPermaLink="false">http://scottbarnham.com/blog/2008/02/21/getselection-returns-empty-in-google-mail/#comment-554</guid>
		<description>Thanks for this info. Exactly my problem, and solution!

Gavin</description>
		<content:encoded><![CDATA[<p>Thanks for this info. Exactly my problem, and solution!</p>
<p>Gavin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Craig Williams</title>
		<link>http://scottbarnham.com/blog/2008/02/21/getselection-returns-empty-in-google-mail/comment-page-1/#comment-426</link>
		<dc:creator>Craig Williams</dc:creator>
		<pubDate>Tue, 09 Sep 2008 06:11:47 +0000</pubDate>
		<guid isPermaLink="false">http://scottbarnham.com/blog/2008/02/21/getselection-returns-empty-in-google-mail/#comment-426</guid>
		<description>Hey Scott,

Thanks for posting this!
It is coming in very handy.</description>
		<content:encoded><![CDATA[<p>Hey Scott,</p>
<p>Thanks for posting this!<br />
It is coming in very handy.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.213 seconds -->

