I have an iOS application that is using a WKWebView
to load in a webpage from https://example.com
into an iframe so that it looks like (not sandboxed):
<iframe id="blah" src="https://example.com/content_to_load" />
In terms of the WKWebView
configuration, there’s no fancy being done – pretty much just using the basic setup. I did set allowFileAccessFromFileURLs
to see if that would change anything but it unfortunately did not.
Within https://example.com/content_to_load
, another iframe is created and loads content from https://example.com/content_to_load_2
(same origins).
however, on iOS, I’m getting the following error when loading up the content_to_load_2
content:
Sandbox access violation: Blocked a frame at “https://example.com” from accessing a frame at “https://example.com”. The frame being access is sandboxed and lacks the “allow-same-origin” flag.
The iframe loading the second content does have sandbox="allow-same-origin"
but even then I wouldn’t think it would matter since both the host and the iframe content have the same origin already.
Also, this only seems to occur on iOS. If I try the same thing on a normal web browser, it works just fine and I do not see the error and everything loads as expected.
Is this a known limitation to iOS or is there some setup step that needs to be done?
I realize that this is quiet vague but it is difficult to see share code since it’s scattered about – I’ll see if I can whip up a small example in the meantime