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
SF PracticeSF Practice 

Uncaught SecurityError: Sandbox access violation

I am receiving an error on VF Page where Clicking on submit button is freezing the screen and not moving it to next vf page. This is only happening with 1 or 2 users.

ERROR 1:
Uncaught SecurityError: Sandbox access violation: Blocked a frame at "https://c.cs7.visual.force.com" from accessing a frame at "https://c.cs7.visual.force.com".  The frame being accessed is sandboxed and lacks the "allow-same-origin" flag.initContentPane @ VFDevMode.js:21initContentFrame @ VFDevMode.js:22

ERROR 2:
Uncaught SecurityError: Failed to read the 'cookie' property from 'Document': The document is sandboxed and lacks the 'allow-same-origin' flag.getCookie @ main.js:75ActivityReminder._checkScheduleUpdates @ main.js:709

Thanks
SonamSonam (Salesforce Developers) 
This might be  happening because of clickjack enabled for the ORG:
https://org62.my.salesforce.com/kA130000000ZZjM?kavVersion=16&lang=en_US&popup=true&caseId=5003000000TzFsv

Kindly check and confirm if this is the case.
 
SF PracticeSF Practice
Hello Sonam,

Thank you for your response.
Clickjack is only enabled setup pages and non setup pages. However, I am facing this issue with VF Page and the clickjack VF page option is not enabled.

Thanks
SonamSonam (Salesforce Developers) 
Ok..which browser are these users using? Is it differenct from those users not facing the issue? Trying to see if its browser based.
SF PracticeSF Practice
Sonam,
Users are using Google Chrome Browser. It is not a browser issue because when I am executing the same, it is not producing this issue. However, when I am login in as user, I am able to produce this.

Thanks
SonamSonam (Salesforce Developers) 
Ok, Can you please check if these user have development mode ON in their user detail page? if ON, can you please uncheck the box and turn it OFF. Try to access the VF page again and see if the issue persists.
SF PracticeSF Practice
Thanks Sonam, this has been fixed. Please suggest why it is occuring with Dev Mode ON with this specific user only.

Thanks again.
SonamSonam (Salesforce Developers) 
The Developer Console is accessed as an Iframe by Salesforce and since you are loading the VF page in Development mode, javascript is accessing that iframe throwing the error message.

 
Juraj CiljakJuraj Ciljak

Hi Sonam,
thanks for this. I been spending hours by using google why this happend :(

Thnaks
Juraj 
Juraj CiljakJuraj Ciljak
Hi Sonam,
but I think this come with some release because previously there was not this kind of issues.

Thanks
​Juraj