Skip to content

Webview using deprecated on_result #3625

Description

@kattni

Describe the bug

When running the Webview example, when clicking on one of the js buttons, the following deprecation warning is thrown:

webview.py:193: DeprecationWarning: Synchronous `on_result` handlers have been deprecated; use `await` on the asynchronous result
  result = JavaScriptResult(on_result=on_result)

Steps to reproduce

  1. Run the webview example code.
  2. Click on "good js" or "bad js".
  3. Check console output.

Expected behavior

Presumably that the error is not present.

Screenshots

No response

Environment

  • Operating System: macOS 15.5
  • Python version: 3.13
  • Software versions:
    • Toga: 0.5.2.dev139+gef79e0427.d20250705

Logs


Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA crash or error in behavior.good first issueIs this your first time contributing? This could be a good place to start!
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions