Skip to content

macOS: Missing UI delegate for WebView (no alerts, <input type="file"> dialog) #22

@denisw

Description

@denisw

Describe the bug

WebKit's WKWebView needs an implementation of WKUIDelegate for some interactions that require native UI bits, such as:

  • JS alerts and prompts (alert(), confirm(), prompt())
  • File dialogs, e.g. when clicking on an <input type="file">

Neutralino does not provide such a delegate (see webview.h). Accordingly, the above browser features do not work on macOS (nothing happens).

To reproduce

  1. Create a new Neutralino project.
  2. Add <input type="file"> to the HTML.
  3. Add alert('foo') call to the JavaScript code.
  4. Run the app with neu run.

Expected behavior

  • I can see a dialog saying "foo" when I start the app.
  • Clicking on the file input opens a file dialog.

Actual behavior

  • No dialog is shown.
  • Clicking on the file input does nothing (but dragging a file from Finder to the file input works).

Specifications

  • OS: macOS 12.6 arm64
  • Neutralinojs version: v4.8.0
  • Neutralinojs client library version: v3.7.0
  • Neutralinojs CLI version: v9.3.1

Additional context

Follow-up of neutralinojs/neutralinojs#1005.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions