I opened a Popup from an inline VF page in SFDC and then after some action I was able to close the window but needed a refresh of the Top window from inline frame .
My code is as below for opening a pop up.Note this is inline page
<apex:page standardController="Account" extensions="Accountctrl">
<apex:form >
<script>
function openwindow(){
window.open("/apex/pagereal", "myWindow", "width=200, height=100");
}
</script>
<apex:pageBlock >
<apex:pageBlockSection columns="1" id="Test" >
<apex:inputcheckbox value="{!test.istest__c}" label="Same as Above">
<apex:actionSupport event="onchange" rerender="Test" />
</apex:inputcheckbox>
<apex:outputPanel rendered="{!NOT(test.istest__c)}">
<apex:inputField value="{!test.Campaign__c}" />
<apex:inputField value="{!test.cust_vendor__c}" />
</apex:outputPanel>
<apex:commandButton value="Tetete" onclick="openwindow();"/>
</apex:pageBlockSection>
</apex:form>
</apex:page>
And my popup page code is as below and I want to redirect top frame from inline page
<apex:page >
<script>
function test(){
alert('hello');
window.opener.top.location.href='https://googleflowauth-dev- ed.my.salesforce.com/001900000096agv';
}
</script>
<apex:form >
<!-- End Default Content REMOVE THIS -->
<apex:commandButton onclick="test()" value="Test"/>
</apex:form>
The error is pretty much I know that it is for security browsers dont allow
Unsafe JavaScript attempt to initiate navigation for frame with URL 'https://googleflowauth-dev-ed.my.salesforce.com/001900000096agv' from frame with URL 'https://googleflowauth-dev-ed–c.ap1.visual.force.com/apex/pagereal'. The frame attempting navigation is neither same-origin with the target, nor is it the target's parent or opener.
I am happy if i get workaround for same
Best Answer
1 -> add a function in your inline page that executes
window.parent.location=
2 -> In the popup execute
rather than trying to refresh directly from the popup?