Skip to content

Linux: the desktop bootstrap page runs no JavaScript, so the startup surface can never report #5416

Closed

Description

@lidge-jun

What happened

On Linux the desktop shell's bootstrap window is a static picture. The page renders, but none of
its JavaScript executes, so the startup surface never reports a phase, never reaches a terminal
state, and never explains itself. The window sits on the markup's default headline — "Starting
OpenCodex…" — with an empty checklist for as long as the app runs.

This is the surface whose entire purpose is to report when startup goes wrong, so on Linux a user
whose runtime fails to start has no information at all.

Steps to reproduce

  1. Build the Debian package from the desktop shell and install it on a GNOME session.
  2. Launch the installed app.
  3. Observe the window: headline unchanged, no phase rows, no terminal state.

What I expected

The phase checklist from the shell's startup sequence, ending in a ready or a failed state with a
copyable diagnostic, as the surface does on the other platforms.

Evidence

The asset itself is fine. An inline probe that fetches the script sees the embedded response:

status=200 ct=text/javascript len=5941

So it is neither a missing asset nor a wrong MIME type. Narrowing further:

  • With the configured csp removed from the shell configuration, the page comes fully alive: the
    checklist renders, "Registering the tray and the login item" completes, and "Resolving the
    configuration home and port" becomes the active row.
  • With the configured csp present, no script runs — not the page's external script, and not
    an inline probe added ahead of it.
  • Widening script-src to name the asset-protocol scheme and host changed nothing.
  • Adding 'unsafe-inline' to script-src also changed nothing, which is the signal that matters:
    'unsafe-inline' is ignored when a nonce or hash is present in the same directive. The policy the
    webview actually enforces is therefore not the policy in the configuration file — something is
    rewriting script-src, and the rewritten value admits neither the page's own script nor an
    inline one.

Why the other surfaces look fine

The dashboard is loaded from the proxy's loopback origin and carries that origin's own headers, so
the shell's asset-protocol policy does not apply to it. Only the embedded bootstrap page is
affected, which is why the product appears to work right up until the moment it needs to explain
itself.

Scope

The fix has to keep a real policy on the embedded page rather than removing it, so it is a decision
about how the bootstrap script is admitted — a nonce or hash the shell injects, or serving the page
so that its own origin is expressible — not a widening of the existing sources. Whatever the
mechanism, it needs a regression that fails when the surface cannot run its own script, because
every existing check reads the source rather than the built page.

Environment

  • Platform: Linux, GNOME session, Debian package built from the current desktop shell.
  • Packaged app version: 2.61.0.

Activity

  1. lidge-jun commented on Sep 21, 2026

    @lidge-jun
    OwnerAuthor

    Fixed by #5445, on dev as 1e233a4.

    The cause was in Tauri's CSP handling rather than in the page: inject_nonce_token only tags script[src^='http'], while replace_csp_nonce adds hashes and nonces to script-src, which makes 'unsafe-inline' inert. The external bootstrap script therefore carried no nonce and was blocked. It is now inlined into desktop/ui/index.html with nonce="__TAURI_SCRIPT_NONCE__", desktop/ui/main.js is gone, and the test oracle reads index.html. Verified on the Linux session: the checklist renders with the policy intact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions