I’m trying to make my webpage post message back to parent page. Using iframe and wixWindow.postMessage() works fine on regular web pages but I cannot make it work on iOS’s WKwebview. It seems to require calling window.webkit.messageHandlers which is not defined on page code. Is there any way to access this namespace?
No. Corvid understands all of Javascript, except for anything that accesses the DOM. Accessing document elements such as div, span, button, etc is off-limits. The way to access elements on the page is only through $w.
One small exception is the $w.HtmlComponent (which is based on an iFrame). This element was designed to contain vanilla HTML and it works just fine. You just can’t try to trick it by using parent, window, top, etc. Same goes with the Javascript evaluate() function. It is sandboxed and does not allow access to the DOM.
Well that’s bummer. Thanks!