JeffBerman opened a new issue, #1684:
URL: https://github.com/apache/cordova-ios/issues/1684

   # Bug Report
   
   ## Problem
   Using `alert()` from JavaScript inside of a Cordova app using Cordova iOS 
8.1.1 does nothing.
   
   ### What is expected to happen?
   An alert message should appear.
   
   
   ### What does actually happen?
   Nothing appears.
   
   
   ## Information
   It appears that cordova-ios 8.1.1 inadvertently broke alert handling, by 
changing some code so that the object responsible for displaying JavaScript 
alerts can be removed. I admittedly used AI to diagnose this, and it reports 
this:
   
   > Cordova iOS 8.1.1 creates a `CDVWebViewUIDelegate` as a local variable and 
assigns it to `WKWebView.UIDelegate`. However, `WKWebView.UIDelegate` is a weak 
property, so it does not retain the delegate. Cordova no longer stores the 
delegate in its own strong `uiDelegate` property. Consequently, ARC deallocates 
the delegate after initialization, and JavaScript functions such as `alert()`, 
`confirm()`, and `prompt()` stop working.
   > 
   > This appears to have been introduced by commit 
[5669c2c9](https://github.com/apache/cordova-ios/commit/5669c2c9cb209f7ba6ecf70e1e2ea86b369fd459),
 which removed the assignment to `self.uiDelegate`.
   
   
   
   ### Command or Code
   ```
   document.addEventListener("deviceready", function () {
       alert("Plain JavaScript alert");
   }, false);
   ```
   
   
   
   ### Environment, Platform, Device
   - iPhone 15 running iOS 26.6
   - App created with Cordova 13.0, Cordova-iOS 8.1.1
   
   
   ### Version information
   Cordova: Cordova CLI 13.0.0, Cordova iOS platform 8.1.1
   No other frameworks
   App built on macOS 15.7.7, Xcode 26.3
   
   
   
   ## 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]

Reply via email to