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

[bug] How do I know if remote content in webview has been loaded normally? #9689

Open
gusxodnjs opened this issue May 7, 2024 · 0 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@gusxodnjs
Copy link

Describe the bug

I have received a URL from the user and am showing this page in webview.
When an invalid url is entered as follows, webview is showing an empty screen. I want to catch this error and expose the error page. How can I do it?

https://www.yahoo.co.jp밍낢ㄴㅇㄹㅁㄴㅇㄹ

image

let _ = WebviewWindowBuilder::new(&app_handle, "test", WebviewUrl::External(url.parse().unwrap()))
                .decorations(false)
                .resizable(false)
                .on_page_load(move |window, payload| {
                    match payload.event() {
                        PageLoadEvent::Started => {}
                        PageLoadEvent::Finished => {
                            // on load
                        }
                    }
                })
                .build()
                .unwrap();

Reproduction

No response

Expected behavior

No response

Full tauri info output

[✔] Environment
    - OS: Mac OS 14.2.1 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.76.0 (07dca489a 2024-02-04)
    ✔ cargo: 1.76.0 (c84b36747 2024-01-18)
    ✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 18.17.1
    - yarn: 1.22.19
    - npm: 9.6.7

[-] Packages
    - tauri [RUST]: 2.0.0-beta.18
    - tauri-build [RUST]: 2.0.0-beta.14
    - wry [RUST]: 0.39.3
    - tao [RUST]: 0.27.1
    - tauri-cli [RUST]: 2.0.0-beta.9
    - @tauri-apps/api [NPM]: 2.0.0-beta.6
    - @tauri-apps/cli [NPM]: 2.0.0-beta.10

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - framework: React
    - bundler: Vite

Stack trace

No response

Additional context

No response

@gusxodnjs gusxodnjs added status: needs triage This issue needs to triage, applied to new issues type: bug labels May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

1 participant