Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] JavaScript alert() or prompt() not working on WebView #2254

Closed
Pairman opened this issue Dec 2, 2023 · 1 comment
Closed

[Android] JavaScript alert() or prompt() not working on WebView #2254

Pairman opened this issue Dec 2, 2023 · 1 comment
Labels
bug A crash or error in behavior.

Comments

@Pairman
Copy link

Pairman commented Dec 2, 2023

Describe the bug

On Android, Toga WebView cannot create dialogs from JS alert() or prompt() in loaded web pages.

Toga on windows has no issue showing JS alerts or prompts. I cannot test this on Ubuntu since I'm using a headless build server.

Steps to reproduce

  1. Use toga to load a webpage (either local or online, with alert() or prompt() set as onclick attribute of buttons) like this:
self.main_window = toga_MainWindow(title = self.formal_name)
                self.main_window.content = toga_Box(
                        children = [
                                toga_WebView(url = "http://127.0.0.1:5001", style = toga_style_Pack(flex = 1))
                        ]
                )
                self.main_window.show()
  1. Build, package and run on Android.
  2. JS alert() or prompt() does nothing when buttons with them as onclick functions are clicked.

Expected behavior

Alert() or prompt() should create jump boxes / dialogs (with input fields) when executed.

Screenshots

No response

Environment

  • Operating System: Ubuntu 20.04 amd64(build) and Android 13 arm64 (test)
  • Python version: 3.10.12
  • Software versions:
    • Briefcase: 0.3.16
    • Toga: 0.4.0
    • ...

Logs

No logs. I'm testing on a real android device.

Additional context

No response

@Pairman Pairman added the bug A crash or error in behavior. label Dec 2, 2023
@mhsmith
Copy link
Member

mhsmith commented Dec 2, 2023

This would require implementing the WebChromeClient class, so please subscribe to #1020 for updates about that.

@mhsmith mhsmith closed this as completed Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A crash or error in behavior.
Projects
None yet
Development

No branches or pull requests

2 participants