tauri-apps / tauri

Build smaller, faster, and more secure desktop applications with a web frontend.
https://tauri.app
Apache License 2.0
81.56k stars 2.44k forks source link

Javascript alert windows works on Mac but not on Windows #848

Closed xudesheng closed 4 years ago

xudesheng commented 4 years ago

Describe the bug alert works on Mac but not on Windows after yarn tauri build

To Reproduce Steps to reproduce the behavior:

  1. Using following code

    useEffect(()=>{
        return ()=>{
            alert("Item about to be deleted!");
        }
    },[]);
  2. Before using Tauri to build, this alert works both on Windows and Mac as expected.

  3. After using Tauri to build, this alert only works on Mac but not on Windows.

Expected behavior Expect a consistent result.

Screenshots Screenshot can be found at: https://github.com/xudesheng/mytodo

When you click delete, you can see an alert windows pops up on Mac but not on Windows.

Mac: https://github.com/xudesheng/mytodo/blob/master/docs/_image/2020-07-17_21-52-02.gif

Windows: https://github.com/xudesheng/mytodo/blob/master/docs/_image/7-17-2020%209-43-32%20PM.gif

Platform and Versions (please complete the following information):

Mac: ` [tauri]: running info

Operating System - Darwin(19.5.0) - darwin/x64

Node.js environment Node.js - 14.4.0 tauri.js - 0.9.1

Rust environment rustc - 1.45.0 cargo - 1.45.0 tauri-bundler - 0.8.5

Global packages NPM - 6.14.6 yarn - 1.22.4

App directory structure /.git /build /docs /node_modules /public /src /src-tauri

App tauri.rs - 0.7.5 mode - embedded-server build-type - bundle CSP - default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' Windows - Edge distDir - ../build devPath - http://localhost:3000/ `

Windows: ` [tauri]: running info

Operating System - Windows_NT(10.0.18363) - win32/x64 Microsoft Edge - 44.18362.449.0_neutral__8wekyb3d8bbwe

Node.js environment Node.js - 12.18.2 tauri.js - 0.9.1

Rust environment rustc - 1.45.0 cargo - 1.45.0 tauri-bundler - 0.8.5

Global packages NPM - 6.14.5 yarn - 1.22.4

App directory structure /.git /build /docs /node_modules /public /src /src-tauri

App tauri.rs - 0.7.5 mode - embedded-server build-type - bundle CSP - default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' Windows - Edge distDir - ../build devPath - http://localhost:3000/ Done in 1.91s. ` Additional context Add any other context about the problem here.

Stack Trace

lucasfernog commented 4 years ago

Seems like we need to create our own alert: https://github.com/r0x0r/pywebview/commit/83a193cd857a4e3d091be451f66bf8d931d5c884