We released our app 2 years ago, it is available on iPhone, iPad and macOS (with catalyst).
Since macOS Monterey, the WKWebview is crashing at random, for different customers it will be a different thing that triggers the crash. It could be a specific button or simply one text box inside a web page and it will be that specific thing all the time that will crash the app from now on. For different customers it will be a different trigger. It could be anything.
The problem is exactly the same on Intel and M1.
Only a restart (or multiple) or a shut down can resolve the problem, but not for everyone, for some people it will be one specific button on one of our 5 000 web pages that will start crashing the app and nothing will ever make it work again.
Of course I cleared the cashes programmatically, even deleted the files and uninstalled the app. The crash dump is mostly the same and in my crash log, there is not a single line of code belonging to my code. The crash is really inside the Safari engine or the WKWebview.
There are other problems with WKWebview since Monterey : Pasting text Cmd+V in web page paste the text twice and dropdown can only be used once, after that they never open again unless you click on an empty space elsewhere. This is on any web pages, not just ours.
Of course none of these problems are happening on iPhone and iPad and they use the exact same code (macCatalyst). Please Apple take the macOS seriously or discontinue the product.
Crash Dump
Application Specific Information:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: <SPRoundedWindow: 0x154e8f060>. "frame=!CGRectIsNull(frame)"'
terminating with uncaught exception of type NSException
abort() called
Application Specific Backtrace 0:
0 CoreFoundation 0x00000001c404eb08 __exceptionPreprocess + 240
1 libobjc.A.dylib 0x00000001c3d99e14 objc_exception_throw + 60
2 Foundation 0x00000001c4fc4c80 -[NSMutableDictionary(NSMutableDictionary) initWithContentsOfFile:] + 0
3 AppKit 0x00000001c6b7fbec -[NSWindow _reallySetFrame:] + 900
4 AppKit 0x00000001c6b7f4ac -[NSWindow _oldPlaceWindow:fromServer:] + 228
5 AppKit 0x00000001c6b7e490 -[NSWindow _setFrameCommon:display:fromServer:] + 2220
6 SafariPlatformSupport 0x00000001eaf26f08 __85-[SPSafariPlatformSupport displayOTPAutoFillRelativeToRect:ofView:completionHandler:]_block_invoke + 300