Mark Mark - 4 days ago 6
Swift Question

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

When you have a WKWebView in an OSX application, when you press a

<input type="file">
button, you can't select a file from your harddisk. How would you enable this feature?

I heard that normally you use:

func webView(sender: WebView!, runOpenPanelForFileButtonWithResultListener resultListener: WebOpenPanelResultListener!)


Which is part of the
WebUIDelegate
but altho you set
self.webView.UIDelegate = self
it does not get fired.

Answer

This is a known bug in WKWebView.

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

Comments