How can you get input file to work in a WKWebView?

后端 未结 2 1451
名媛妹妹
名媛妹妹 2021-01-14 17:34

When you have a WKWebView in an OSX application, when you press a button, you can\'t select a file from your harddisk. How would you

相关标签:
2条回答
  • 2021-01-14 18:11

    This is a known bug in WKWebView.

    https://bugs.webkit.org/show_bug.cgi?id=137759

    0 讨论(0)
  • 2021-01-14 18:22

    Here is the 100% working solution for WKWebview "File Upload" Problem.

    You just need to implement the UIDelegate:

    - (void)webView:(WKWebView *)webView runOpenPanelWithParameters:(WKOpenPanelParameters *)parameters initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(NSArray<NSURL *> *URLs))completionHandler;
    

    Follow this link for more description about this delegate: RunOpenPanel Delegate

    0 讨论(0)
提交回复
热议问题