You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An iframe in our app triggers a navigation action via window.open or window.top.location.href to a url that is in our allow-intent allow list. The url is correctly opened in the system browser. However after it is opened window.webkit.messageHandlers is undefined which causes runtime errors within the cordova exec.js file when it attempts to use the cordova message handler to post a message.
TypeError
null is not an object (evaluating 'window.webkit.messageHandlers.cordova')
What is expected to happen?
The URL opened by the iframe should be opened in the system browser without triggering errors within the cordova app.
What does actually happen?
After the URL is opened window.webkit.messageHandlers undefined errors occur
Information
Command or Code
Environment, Platform, Device
This issues appears to happen on any iOS mobile device.
Also, the linked bug has some mention of App-Bound Domains, which aren't something that has been thoroughly tested on the Cordova side. Is your app using App-Bound Domains?
To clarify: when you say "system browser" you mean opening in Safari (or Chrome, etc.) and leaving the Cordova app, right?
and then webkit.messageHandlers is undefined when you return to the Cordova app?
Correct
Also, the linked bug has some mention of App-Bound Domains, which aren't something that has been thoroughly tested on the Cordova side. Is your app using App-Bound Domains?
It does look like our app is setting a number of WKAppBoundDomains and the iframe url is not one of them. I can investigate updating them.
Bug Report
Problem
An iframe in our app triggers a navigation action via
window.open
orwindow.top.location.href
to a url that is in our allow-intent allow list. The url is correctly opened in the system browser. However after it is opened window.webkit.messageHandlers is undefined which causes runtime errors within the cordova exec.js file when it attempts to use the cordova message handler to post a message.TypeError
null is not an object (evaluating 'window.webkit.messageHandlers.cordova')
What is expected to happen?
The URL opened by the iframe should be opened in the system browser without triggering errors within the cordova app.
What does actually happen?
After the URL is opened window.webkit.messageHandlers undefined errors occur
Information
Command or Code
Environment, Platform, Device
This issues appears to happen on any iOS mobile device.
Version information
Checklist
I searched for existing GitHub issues
IOS 15.1: TypeError: undefined is not an object (evaluating 'window.webkit.messageHandlers') #1214 looks potentially related but does not callout the error being triggered by iframe calls to
window.open
orwindow.top.location.href
I updated all Cordova tooling to most recent version
I included all the necessary information above
The text was updated successfully, but these errors were encountered: