Repository: tauri
Issue: [bug] tauri 1.4 selenium webdriver getAllWindowHandles causes webkitgtk webview.url() to panic in Linux
Labels: type: bug,platform: Linux,scope: webdriver,status: needs triage

### Describe the bug

After upgrading tauri to 1.4, when I ran my E2E tests via selenium webdriver on ubuntu, I was not able to get the windowHandles via `const handles = await driver.getAllWindowHandles();`
It will show the following error:
```
 1) "before all" hook in "{root}"

  0 passing (2m)
  1 failing

  1) "before all" hook in "{root}":
     NoSuchSessionError: session deleted because of page crash or hang.
      at Object.throwDecodedError (node_modules/selenium-webdriver/lib/error.js:524:15)
      at parseHttpResponse (node_modules/selenium-webdriver/lib/http.js:601:13)
      at Executor.execute (node_modules/selenium-webdriver/lib/http.js:529:28)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at WebDriver.execute (node_modules/selenium-webdriver/lib/webdriver.js:745:17)
      at Context.<anonymous>
```
And when I look at the log, it will show:
```
ERROR  thread 'main' panicked at 'called `Option::unwrap()` on a `None` value': /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/wry-0.24.3/src/webview/webkitgtk/mod.rs:391
   0: <backtrace::capture::Backtrace as core::default::Default>::default
   1: log_panics::Config::install_panic_hook::{{closure}}
   2: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/alloc/src/boxed.rs:2001:9
      std::panicking::rust_panic_with_hook
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:696:13
   3: std::panicking::begin_panic_handler::{{closure}}
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:581:13
   4: std::sys_common::backtrace::__rust_end_short_backtrace
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:150:18
   5: rust_begin_unwind
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:579:5
   6: core::panicking::panic_fmt
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:64:14
   7: core::panicking::panic
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:114:5
   8: wry::webview::webkitgtk::InnerWebView::url
   9: wry::webview::WebView::url
  10: tauri_runtime_wry::handle_user_message
  11: tauri_runtime_wry::send_user_message
  12: <tauri_runtime_wry::WryDispatcher<T> as tauri_runtime::Dispatch<T>>::url
  13: tauri::window::Window<R>::on_message
  14: tauri::manager::WindowManager<R>::prepare_ipc_handler::{{closure}}
  15: tauri_runtime_wry::create_ipc_handler::{{closure}}
  16: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
  17: <O as webkit2gtk::auto::user_content_manager::UserContentManagerExt>::connect_script_message_received::script_message_received_trampoline
  18: g_closure_invoke
  19: <unknown>
  20: g_signal_emit_valist
  21: g_signal_emit
  22: <unknown>
  23: <unknown>
  24: <unknown>
  25: <unknown>
  26: <unknown>
  27: <unknown>
  28: <unknown>
  29: <unknown>
  30: <unknown>
  31: <unknown>
  32: <unknown>
  33: g_main_context_dispatch
  34: <unknown>
  35: g_main_context_iteration
  36: gtk_main_iteration_do
  37: gtk::auto::functions::main_iteration_do
  38: glib::main_context::<impl glib::auto::main_context::MainContext>::with_thread_default
  39: tao::platform_impl::platform::event_loop::EventLoop<T>::run_return
  40: tao::platform_impl::platform::event_loop::EventLoop<T>::run
  41: tao::event_loop::EventLoop<T>::run
  42: <tauri_runtime_wry::Wry<T> as tauri_runtime::Runtime<T>>::run
  43: ctdx::main
  44: std::sys_common::backtrace::__rust_begin_short_backtrace
  45: std::rt::lang_start::{{closure}}
  46: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/ops/function.rs:287:13
      std::panicking::try::do_call
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:487:40
      std::panicking::try
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:451:19
      std::panic::catch_unwind
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panic.rs:140:14
      std::rt::lang_start_internal::{{closure}}
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/rt.rs:148:48
      std::panicking::try::do_call
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:487:40
      std::panicking::try
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:451:19
      std::panic::catch_unwind
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panic.rs:140:14
      std::rt::lang_start_internal
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/rt.rs:148:20
  47: main
  48: __libc_start_call_main
             at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
  49: __libc_start_main_impl
             at ./csu/../csu/libc-start.c:392:3
  50: _start

```

### Reproduction

This should be reproduced with tauri 1.4, when we try to run a selenium webdriver test and calling `driver.getAllWindowHandles()` on Linux, this induces "/home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/wry-0.24.3/src/webview/webkitgtk/mod.rs:391" when it tries to get the webview.uri of webkitgtk, it will panic.
```
  pub fn url(&self) -> Url {
    let uri = self.webview.uri().unwrap();

    Url::parse(uri.as_str()).unwrap()
  }
```

### Expected behavior

_No response_

### Platform and versions

```text
[✔] Environment
    - OS: Ubuntu 22.04 X64
    ✔ webkit2gtk-4.0: 2.38.6
    ✔ rsvg2: 2.52.5
    ✔ rustc: 1.69.0 (84c898d65 2023-04-16)
    ✔ Cargo: 1.69.0 (6e9a83356 2023-04-12)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (environment override by RUSTUP_TOOLCHAIN)
    - node: 20.1.0
    - npm: 9.8.0

[-] Packages
    - tauri [RUST]: 1.4.1
    - tauri-build [RUST]: 1.4.0
    - wry [RUST]: 0.24.3
    - tao [RUST]: 0.16.2
    - @tauri-apps/api [NPM]: 1.3.0 (outdated, latest: 1.4.0)
    - @tauri-apps/cli [NPM]: 1.4.0

[-] App
    - build-type: bundle
    - CSP: font-src data:; default-src 'self'; img-src data:
    - distDir: ../dist
    - devPath: http://localhost:1420/
    - framework: React
    - bundler: Vite
```


### Stack trace

_No response_

### Additional context

_No response_