Same crash is happening in my coredova application for iOS 16 only.
Added above script in CDVWebViewEngine, still crashing.
NSString *scriptcode = [NSString stringwithFormate:@"deletewindow.SharedWorker;"]; WKUserScript *wkScript = [WKUserScript alloc] initWithSource:scriptCode injectionTime:WKUserScriptInjectionTimeAtDocumentStart for mainframe only:YES]; [userContentcontroller addUserScript];
CDVViewcontrollerer webview is getting nil hence causes crash.
Looking forward for any help
Thanks.
Post
Replies
Boosts
Views
Activity
Have same issue in My cordova application.
Even after applying above script Still its crashing in iOS 16.
Added script like below in CDVWebEngine.
WKUserScript *wkScript = [[WKUserScript alloc] initWithSource:scriptCode injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:YES];
[userContentController addUserScript:wkScript];
WKWebViewConfiguration* configuration = [self createConfigurationFromSettings:settings];
configuration.userContentController = userContentController;
WKWebView* wkWebView = [[WKWebView alloc] initWithFrame:self.engineWebView.frame configuration:configuration];
override func viewDidLoad() {
super.viewDidLoad()
}
}
if let tempWidgetVC = storyboard.instantiateViewController(withIdentifier: "SampleController") as? SampleController {
tempWidgetVC.view.frame = CGRect(x: 0, y: 135, width: self.view.frame.size.width, height: self.view.frame.size.height - 150)
self.view.addSubview(tempWidgetVC.webView)
}
webview is getting nil in iOS 16 hence crash is happening on self.view.addSubview(tempWidgetVC.webView)
Looking forward for any help suggestion
Thanks