function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
David81David81 

Set "target" attribute of links within iframe on Home Tab?

I'm just starting my journey into VF so please excuse me if this is a rudimentary question.

 

Our sales dept. has requested a different layout for the "Tasks" area on the home page. Seeing as how we can't customize the columns in this area, I've looked into replacing it with a VF page in an iframe. So far so good.

 

The code I'm using is pretty simple but accomplishes the basic goal except for one glaring problem, any links that are clicked stay within the iframe.  

 

Here's the page that's currently being embedded-

 

________

 

<apex:page StandardController="Task" sidebar="false">

 

<div style="position:absolute; top:-95px; left:0; width:100%;">

<apex:enhancedList type="Activity" height="300" />

</div>

 

</apex:page>

 

________

 

Is there any way I can redirect those links to the parent window? My normal javascript tricks just don't seem to work.

 

Thanks in advance. 

bob_buzzardbob_buzzard

Sounds like you are running into the cross site scripting problem that many people have hit before.  

 

 

The VF page embedded in your home page is from a different server to the home page, thus your browser won't allow you to control what happens to the parent page for security reasons.

 

 

David81David81

I was hoping I might be able to use some apex magic on the VF page itself that would set the "target" attribute of all the links to "_top". If not, then this probably kills the replacement of the Tasks area on the Home tab.

 

The odd thing is, when viewing the page by itself in Dev mode, they all have the target set to "_top". Leave Dev mode and they lose the "target" attribute all together.