You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2022/09/23 21:57:20 UTC
[GitHub] [cordova-ios] elisemn opened a new issue, #1261: window.webkit.messageHandlers undefined after iframe triggers navigation action
elisemn opened a new issue, #1261:
URL: https://github.com/apache/cordova-ios/issues/1261
# Bug Report
## Problem
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
<!-- Include all relevant information that might help understand and reproduce the problem -->
### Command or Code
### Environment, Platform, Device
This issues appears to happen on any iOS mobile device.
### Version information
<!--
What are relevant versions you are using?
For example:
Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins
Other Frameworks: Ionic Framework and CLI version
Operating System, Android Studio, Xcode etc.
-->
```
Cordova Packages:
cli: 11.0.0
common: 4.0.2
create: 4.0.0
lib: 11.0.0
common: 4.0.2
fetch: 3.0.1
serve: 4.0.0
Project Installed Platforms:
ios: 6.2.0
```
## Checklist
- [x] I searched for existing GitHub issues
- https://github.com/apache/cordova-ios/issues/1214 looks potentially related but does not callout the error being triggered by iframe calls to `window.open` or `window.top.location.href`
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-ios] dpogue commented on issue #1261: window.webkit.messageHandlers undefined after iframe triggers navigation action
Posted by GitBox <gi...@apache.org>.
dpogue commented on issue #1261:
URL: https://github.com/apache/cordova-ios/issues/1261#issuecomment-1256717867
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?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [I] window.webkit.messageHandlers undefined after iframe triggers navigation action [cordova-ios]
Posted by "dpogue (via GitHub)" <gi...@apache.org>.
dpogue commented on issue #1261:
URL: https://github.com/apache/cordova-ios/issues/1261#issuecomment-2543032502
Having looked into this a bit more, it appears to be the intended behaviour when App-Bound Domains are involved.
From https://webkit.org/blog/10882/app-bound-domains/ (emphasis mine):
> Due to the asynchronous nature of the web, a SocialApp developer could see different errors if trying to use restricted APIs and navigate to non app-bound domains in the same `WKWebView`. If a `WKWebView` in SocialApp uses a restricted API before any navigations occur, and then tries to navigate to a domain outside of the set of “app-bound” domains, the navigation will fail with the error “App-bound domain failure.” **Conversely, if SocialApp first navigates to a non-app-bound domain then tries to use a restricted API, the API call will fail.**
I don't think there's anything Cordova can do here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-ios] elisemn commented on issue #1261: window.webkit.messageHandlers undefined after iframe triggers navigation action
Posted by GitBox <gi...@apache.org>.
elisemn commented on issue #1261:
URL: https://github.com/apache/cordova-ios/issues/1261#issuecomment-1256782369
> 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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [I] window.webkit.messageHandlers undefined after iframe triggers navigation action [cordova-ios]
Posted by "dpogue (via GitHub)" <gi...@apache.org>.
dpogue closed issue #1261: window.webkit.messageHandlers undefined after iframe triggers navigation action
URL: https://github.com/apache/cordova-ios/issues/1261
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-ios] dpogue commented on issue #1261: window.webkit.messageHandlers undefined after iframe triggers navigation action
Posted by GitBox <gi...@apache.org>.
dpogue commented on issue #1261:
URL: https://github.com/apache/cordova-ios/issues/1261#issuecomment-1256719358
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?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org