sunoru / Webviews.jl

🌐 Julia implementation of webview, a tiny library for creating web-based desktop GUIs.
https://sunoru.github.io/Webviews.jl/
MIT License
33 stars 0 forks source link

multiple example crash on macOS #14

Closed xgdgsc closed 1 year ago

xgdgsc commented 1 year ago
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.9.2 (2023-07-05)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using Webviews

julia> webview1 = Webview()
Inspection is enabled by default for process or parent application with 'com.apple.security.get-task-allow' entitlement linked against old SDK. Use `inspectable` API to enable inspection on newer SDKs.
Webview (0 bindings): pending

julia> webview2 = Webview()

[2490] signal (11.2): Segmentation fault: 11
in expression starting at REPL[3]:1
objc_registerClassPair at /usr/lib/libobjc.A.dylib (unknown line)
Allocations: 1379772 (Pool: 1378679; Big: 1093); GC: 2
zsh: segmentation fault  julialauncher

Thanks for the package. I see the crash when trying the multiple.jl example. And it seems OK with 127.0.0.1 URL while not working with external URL. Is there a security setting to make external URL work?

sunoru commented 1 year ago

Hi thanks for reporting this. I'll look into it. Can you also provide your versioninfo()?

xgdgsc commented 1 year ago
julia> versioninfo()
Julia Version 1.9.2
Commit e4ee485e909 (2023-07-05 09:39 UTC)
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 12 × Apple M2 Max
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, apple-m1)
  Threads: 1 on 8 virtual cores
Environment:
  JULIA_PKG_SERVER = https://mirrors.sjtug.sjtu.edu.cn/julia
sunoru commented 1 year ago

The original implementation of webview actually doesn't support creating multiple windows on macOS, but now it's fixed in this package.

Just wait for https://github.com/JuliaRegistries/General/pull/87145 to be merged and update the package. Please feel free to file another issue or reopen this one if you have any problems after the update.

xgdgsc commented 1 year ago

Thanks. What about the external URL question?

sunoru commented 1 year ago

Ah sorry I missed that. I couldn't reproduce the issue about external URLs on my laptop. Do you have more information?

sunoru commented 1 year ago

It might be related to NSAllowsArbitraryLoads. The webview allows only https connections by default. Maybe I should fix this too.

xgdgsc commented 1 year ago

Turns out it' s the site that I tested with( https://www.baidu.com/) doesn' t work. Other sites work.