The use of Wkwebview will appear when you do some of the pages have a prompt box, why use other People's Page prompt box is always not displayed, in fact, a large part of the reason is because the prompt box is called by JS, you need to implement wkuidelegate to monitor
MARK:-wkuidelegate//monitoring via JS call warning box func WebView (_ Webview:wkwebview, runjavascriptalertpanelwithmessage mes Sage:string, Initiatedbyframe frame:wkframeinfo, Completionhandler: @escaping (), Void) {Let alert = Uialer Tcontroller (Title:nil, Message:message, Preferredstyle:. Alert) Alert.addaction (uialertaction (title: "OK", style: . Default, Handler: {(action) in Completionhandler ()})) Self.present (alert, animated:true, com PLETION:NIL)}//Listen through JS call Prompt box Func WebView (_ Webview:wkwebview, Runjavascriptconfirmpanelwithmessage messag E:string, Initiatedbyframe frame:wkframeinfo, Completionhandler: @escaping (Bool), Void) {Let alert = Uiale Rtcontroller (Title:nil, Message:message, Preferredstyle:. Alert) Alert.addaction (uialertaction (title: "OK", style :. Default, Handler: {(action) in Completionhandler (True)})) Alert.addaction (Uialertaction (titl E: "Cancel", Style:. defAult, Handler: {(action) in Completionhandler (False)})) Self.present (alert, animated:true, com PLETION:NIL)}//Listen JS call input box func WebView (_ Webview:wkwebview, Runjavascripttextinputpanelwithprompt prompt: String, defaulttext:string, Initiatedbyframe frame:wkframeinfo, Completionhandler: @escaping (String), Void) { Similar to the above two methods}
It is important to note that Completionhandler must be called, otherwise it will go wrong!
Wkwebview do not display the prompt box (Swift)