Execute java script in ios15 system, h5 developers cannot get the value on the window. System below ios15 is normal
iOS15 ,WkWebview,evaluateJavaScript
I have meet the same error. Maybe the WKWebview function "evaluateJavaScript:" occurs some problems. Try another way to inject your code to solve this problem. For example
WKUserScript *script = [[WKUserScript alloc] initWithSource:@"window.exeData = '1'" injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:NO];
[webView.configuration.userContentController addUserScript:script];
Hope this way can help you.
What will happen to existing apps who use evaluateJavascript (with custom property added to window object) and upgrade to iOS 15? Won't they stop working?
-(void)webView:(WKWebView*)webView didFinishNavigation:(WKNavigation*)navigation
After webVIew is loaded and then use evaluateJavascript to load custom properties can also be successful