UIWebView on iOS 9 beta makes apps using Angular.js ngRoute crash
Originator: | victor.borrull | ||
Number: | rdar://22186109 | Date Originated: | 07/08/2015 |
Status: | Open | Resolved: | |
Product: | iOS | Product Version: | 9.0 beta |
Classification: | Serious Bug | Reproducible: | Always |
Summary: UIWebView on iOS 9 (up to beta 5) makes Angular.js ngRoute crash with an infinite digest on a location change. This affects Cordova/Phonegap based apps using Angular route, as well as fully native apps displaying external webpages using Angular/ngRoute. Steps to Reproduce: 1. Open attached XCode project 2. Run 3. Attach Safari Web Inspector 4. Click on the link 5. Check the crash on Safari Web Inspector Expected Results: Angular doesn't enter an infinite digest loop. Actual Results: Angular enters on an infinite digest loop, javascript execution is halted. Version: iOS 9 beta 2,3,4,5 (probably 1 as well) Notes: This issue didn't happen on previous UIWebView implementations. It also doesn't occur on Mobile Safari, Desktop Safari, Latests Webkit nightly builds, recent versions of Chrome, IE or FireFox. Configuration: Any iOS 9 beta (at least 2 to 5) devices and simulators Attachments: 'uiwebview.zip' was successfully uploaded.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
The problem is not Angular-specific
The problem is not Angular specific and can be easily reproduced with vanilla javascript:
Sample project demonstrating issue setting location.hash
Here is a link to a project that demonstrates a delay in assigning the location.href value. Compare the behavior between iOS 9 and iOS 8 . I believe this is the root cause, and it's hard to tell if it's an Angular or an iOS issue.
https://www.dropbox.com/s/2jkwv2thhm86nly/iOS%209%20Location%20Bug.zip?dl=0
Thank you, - Sean
Attachment
Xcode project that reproduces the problem (JS taken from @santaslow on https://github.com/angular/angular.js/issues/12241) http://s000.tinyupload.com/index.php?file_id=06705112618062242331