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
Singh_IndupalSingh_Indupal 

Service Console Issue - unable to get Iframe Id from javascript in VF Page

Hi All, 

I have a requirement where i need to get the id of a field in case layout using VF Page as sidebar component in the service console.
I have created a VF page and added a javascript in it.
Below is the javascript code:
var fId = parent.document.getElementById('frameId');
frameId is the Id of the case layout IFRAME.

In the browser console i am getting below error
Blocked a frame with origin "https://****.visual.force.com" from accessing a cross-origin frame.

I have checked and found out this related to "Same Origin Policy"
http://stackoverflow.com/questions/3076414/ways-to-circumvent-the-same-origin-policy

How can we overcome this in VF Page??
 
sandeep madhavsandeep madhav
Accessing a cross-origin frame is violation of browser. Please check the below link:

http://www.roseindia.net/java/pass-value-example/pass-value-from-iframe-parent.shtml

Mark this as best answer if this helps