Repository: tauri
Issue: [bug] Opening a webview window from Rust on linux fails parsing the url
Labels: type: bug,status: needs triage

### Describe the bug

Sometimes when opening a webview window on Linux from Rust with ``` WebviewUrl::App ``` the window opens but the url of it is ``` Err(InvalidUrl(RelativeUrlWithoutBase)) ```. This causes the window to be empty.

![Image](https://github.com/user-attachments/assets/ef39318e-23e7-469b-8186-1b958e2034bd)

I say sometimes because this problem goes away somewhat randomly. Things that made it disappear are not closing the splash screen and disabling the splash screen.

### Reproduction

Have an new_playlist.html in the public directory ``` {project}/public/new_playlist.html ```.

```
    let window_url = "/new_playlist.html";
    println!("window url: {}", window_url);

    let new_window = tauri::WebviewWindowBuilder::new(
        &app,
        "new_playlist",
        WebviewUrl::App(window_url.into())
    ).build();

    match new_window {
        Ok(_window) => {
            println!("Window created: {:?}", _window.url());
            _window.set_title("New Playlist");
            _window.set_size(tauri::LogicalSize::new(200, 200));
            _window.show();
        },
        Err(e) => {
            error!("Error creating window {label}: {e}");
            return Err(())
        },
    };
```

### Expected behavior

The url of the window gets recognized correctly and the webview content loads.

### Full `tauri info` output

```text
[✔] Environment
    - OS: Manjaro 24.2.1 x86_64 (X64)
    ✔ webkit2gtk-4.1: 2.46.4
    ✔ rsvg2: 2.59.2
    ✔ rustc: 1.84.0 (9fc6b4312 2025-01-07)
    ✔ cargo: 1.84.0 (66221abde 2024-11-19)
    ✔ rustup: 1.27.1 (2024-05-07)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (environment override by RUSTUP_TOOLCHAIN)
    - node: 23.3.0
    - npm: 10.9.2

[-] Packages
    - tauri 🦀: 2.2.3
    - tauri-build 🦀: 2.0.5
    - wry 🦀: 0.48.1
    - tao 🦀: 0.31.1
    - tauri-cli 🦀: 2.0.2
    - @tauri-apps/api : 2.2.0
    - @tauri-apps/cli : 2.0.2 (outdated, latest: 2.2.5)

[-] Plugins
    - tauri-plugin-fs 🦀: 2.0.1
    - @tauri-apps/plugin-fs : 2.2.0
    - tauri-plugin-shell 🦀: 2.2.0
    - @tauri-apps/plugin-shell : 2.2.0

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

### Stack trace

```text

```

### Additional context

tauri.conf.json

```
{
  "$schema": "https://schema.tauri.app/config/2.0.0",
  "productName": "test",
  "version": "0.1.0",
  "identifier": "com.test.app",
  "build": {
    "beforeDevCommand": "npm run dev",
    "devUrl": "http://localhost:1420",
    "beforeBuildCommand": "npm run build",
    "frontendDist": "../dist"
  },
  "app": {
    "windows": [
      {
        "title": "app",
        "width": 800,
        "height": 600
      },
      {
        "width": 400,
        "height": 200,
        "visible": true,
        "decorations": false,
        "url": "/splashscreen.html",
        "label": "splashscreen"
      }
    ],
    "security": {
      "csp": null,
      "capabilities": ["default"],
      "assetProtocol": {
        "enable": true,
        "scope": [
          "*/**"
        ]
      }
    }
  },
  "bundle": {
    "active": true,
    "targets": "all",
    "icon": [
      "icons/32x32.png",
      "icons/128x128.png",
      "icons/128x128@2x.png",
      "icons/icon.icns",
      "icons/icon.ico"
    ]
  }
}

```