ionic-team / cordova-plugin-wkwebview-engine

Mirror of Apache Cordova wkwebview engine plugin
Apache License 2.0
290 stars 69 forks source link

iframe contexts inaccessible #39

Open Zorgatone opened 8 years ago

Zorgatone commented 8 years ago

I have an iframe within my app. It was working with UIWebView.

but now with WKWebView it gives me the error Blocked a frame with origin "null" from accessing a frame with origin "null". Protocols, domains, and ports must match. when I try to access window.top from the inner iframe

manucorporat commented 8 years ago

@Zorgatone related https://github.com/driftyco/cordova-plugin-wkwebview-engine/issues/3 ? it could be a server-side issue due CORS

Zorgatone commented 8 years ago

@manucorporat No. Both the html pages are local (and loaded with file:// by Cordova), and that's where the "null" origin part of the error comes. Basically the page within the iframe can't access the context of the "top window", because of "different origins. Altough there is no "origin" on local files and it shows as "null". The weird part is that "null" is not equal to "null", the error log says..

michaelpeterlee commented 7 years ago

We also experience issue with iFrame from local source not loading with origin error message. Inspecting in Safari debugger, parent document.origin = 'file__0'.

michaelpeterlee commented 7 years ago

iFrame initialises before being subsequently denied. Could be this WebKit issue: https://issues.apache.org/jira/browse/CB-11885?jql=project%20%3D%20CB%20AND%20labels%20%3D%20wkwebview-known-issues