<?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>Patrik Duditš &#187; Javascript</title>
	<atom:link href="http://pato.dudits.net/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://pato.dudits.net</link>
	<description>IT &#38; music blog of Patrik Duditš</description>
	<lastBuildDate>Sat, 12 Sep 2009 19:13:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>window.opener.location &#8211; access denied</title>
		<link>http://pato.dudits.net/2008/07/08/windowopenerlocation-access-denied/</link>
		<comments>http://pato.dudits.net/2008/07/08/windowopenerlocation-access-denied/#comments</comments>
		<pubDate>Tue, 08 Jul 2008 10:51:49 +0000</pubDate>
		<dc:creator>Patrik Duditš</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[enterprise portal]]></category>
		<category><![CDATA[navigation]]></category>

		<guid isPermaLink="false">http://pato.dudits.net/?p=12</guid>
		<description><![CDATA[<p>Let&#8217;s have a look at my programming duties today. The plot goes like this: There is a Web Dynpro within Enterprise Portal (I don&#8217;t know proper English fairy tale style, but this sentence feels similar to &#8216;In a dark, filthy cave lived a horryfying twelve-headed fire-spitting dragon&#8217;). This web dynpro opens external window with a [...]</p>
]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s have a look at my programming duties today. The plot goes like this: There is a Web Dynpro within Enterprise Portal (I don&#8217;t know proper English fairy tale style, but this sentence feels similar to &#8216;In a dark, filthy cave lived a horryfying twelve-headed fire-spitting dragon&#8217;). This web dynpro opens external window with a JSPDynPage portal component.</p>
<p>Amongst other functionality there is a button, which switches application on the opening window. Since it&#8217;s a webdynpro in a portal, we need to use <code>window.opener.top.location</code>, as webdynpro is within a frame (or iframe). First time in works. Second time, Internet Explorer yields Access Denied.</p>
<p>You think: Common cross-site scripting issue. But we only do <code>window.location.href="/irj/portal?NavigationTarget=ROLES://..."</code>, so no server is changed. The new component sits at same server as well. And it worked for the first time! Window opener still exists, but any access to it returns Access Denied. And the cause is, that we didn&#8217;t change <code>window.opener</code>, we changed <code>window.opener.top</code>, and thus <code>window.opener</code> is no longer valid. Once you realize that, the solution is pretty straightforward:</p>
<pre>this.windowopenertop = window.opener.top;
this.windowopenertop.location.href=role1url;</pre>
<p>and then later</p>
<pre>this.windowopernetop.location.href=role2url;</pre>
<p>&#8230;and the dragon lived happy ever after (though the user can choose to see another dragon at same location).</p>
]]></content:encoded>
			<wfw:commentRss>http://pato.dudits.net/2008/07/08/windowopenerlocation-access-denied/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
