This example is running in WebGL2 and should work in most browsers. You can check the WebGPU examples here.
//! Shows how to set the solid color that is used to paint the window before the frame gets drawn.
//! Acts as background color, since pixels that are not drawn in a frame remain unchanged.

use bevy::{color::palettes::css::PURPLE, prelude::*};

fn main() {
        .insert_resource(ClearColor(Color::srgb(0.5, 0.5, 0.9)))
        .add_systems(Startup, setup)
        .add_systems(Update, change_clear_color)

fn setup(mut commands: Commands) {

fn change_clear_color(input: Res<ButtonInput<KeyCode>>, mut clear_color: ResMut<ClearColor>) {
    if input.just_pressed(KeyCode::Space) {
        clear_color.0 = PURPLE.into();