lmvco opened a new issue, #1577: URL: https://github.com/apache/cordova-android/issues/1577
# Bug Report ## Problem I recently updated the webview of my Android to version 111.x and, after that, I am not able to remote debug my Android app anymore. In fact, I followed this approach - https://www.girish.in/how-remote-debugging-works-in-chrome/ - to debug my Cordova Android app and it worked until the mentioned update. After that, when opening the socket to the `WebSocketDebuggerUrl` (that I got from sessions list), the socket connection failed (with a 403 forbidden response). Furthermore, I found this error message in Android logs: ```03-29 11:19:21.988 3631 3631 E chromium: [ERROR:devtools_http_handler.cc(766)] Rejected an incoming WebSocket connection from the ws://127.0.0.1:9222 origin. Use the command line flag --remote-allow-origins=ws://127.0.0.1:9222 to allow connections from this origin or --remote-allow-origins=* to allow all origins``` This remote allow origin was, in fact, introduced in Chrome 111 - see [here](https://bugs.chromium.org/p/chromium/issues/detail?id=1422444) - but since in Cordova apps we don't launch Chrome explicitly, I am stuck without being able to debug. ### What is expected to happen? We need to understand how to provide the `remote-allow-origins` parameter to Android webview so we can debug Cordova Android applications ### What does actually happen? The debug does not start since the socket connection to debug URL fails with a 403 forbidden response. ## Information 1. When debugging webpages in Chrome desktop, we faced a similar issue when upgrading to Chrome 111 but, as expected, adding the `remote-allow-origins` parameter when launching Chrome was enough to overcome the issue 2. We tried to downgrade the Android Webview to version 110 and this issue did not happen anymore. We were able to debug the Cordova apps using exactly the same code and scripts. ### Command or Code <!-- What command or code is needed to reproduce the problem? --> ### Environment, Platform, Device Android 13 ### 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. --> ## Checklist <!-- Please check the boxes by putting an x in the [ ] like so: [x] --> - [x] I searched for existing GitHub issues - [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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
