Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Build and Release

on:
push:
tags:
- 'v*'
pull_request:
branches:
- main

jobs:
build:
runs-on: windows-latest
permissions:
contents: write
id-token: write
attestations: write
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: >-
mingw-w64-ucrt-x86_64-clang
mingw-w64-ucrt-x86_64-cmake
mingw-w64-ucrt-x86_64-ninja

- name: Build with LLVM/Clang
shell: msys2 {0}
run: |
cmake -S . -B build -G Ninja \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_BUILD_TYPE=MinSizeRel
cmake --build build

- name: Attest Build Provenance
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/attest@v4
with:
subject-path: build/umpdc.dll

- name: Upload Artifact
uses: actions/upload-artifact@v7
with:
name: umpdc-dll
path: build/umpdc.dll

release:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download Artifact
uses: actions/download-artifact@v8
with:
name: umpdc-dll

- name: Create Release
uses: softprops/action-gh-release@v3
with:
files: umpdc.dll
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 0 additions & 7 deletions Build.cmd

This file was deleted.

35 changes: 35 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
cmake_minimum_required(VERSION 3.10)
project(NoSteamWebHelper C)

add_library(umpdc SHARED src/Library.c)

# Extreme size optimization & no stdlib
if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(umpdc PRIVATE
-Oz
-municode
-fno-stack-protector
-fno-ident
-fno-asynchronous-unwind-tables
-ffunction-sections
-fdata-sections
)
target_link_options(umpdc PRIVATE
-nostdlib
-Wl,--gc-sections
-Wl,--exclude-all-symbols
-Wl,--no-insert-timestamp
-s
)
target_link_libraries(umpdc PRIVATE ntdll kernel32 user32 advapi32 shell32)
elseif(MSVC)
target_compile_options(umpdc PRIVATE /O1 /GS- /Zl)
target_link_options(umpdc PRIVATE
/NODEFAULTLIB
/ENTRY:DllMainCRTStartup
/OPT:REF
/OPT:ICF
/MERGE:.rdata=.text
)
target_link_libraries(umpdc PRIVATE ntdll.lib kernel32.lib user32.lib advapi32.lib shell32.lib)
endif()
46 changes: 46 additions & 0 deletions GEMINI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# NoSteamWebHelper - Instructions & Context

## Project Overview
NoSteamWebHelper is a high-performance Win32 utility (C-based) that dynamically disables Steam's Chromium Embedded Framework (CEF) / WebHelper when a game is running. It aims to replace the removed `-no-browser` flag, freeing system resources while keeping Steam functional.

### Architecture
- **Language**: Pure C (Win32 API), optimized for binary size (`nostdlib`).
- **Core Component**: `umpdc.dll`, designed to be loaded via DLL side-loading/injection (placed next to `steam.exe`).
- **Mechanics**:
- **Event Hooking**: Uses `SetWinEventHook` to detect Steam window creations.
- **Registry Monitoring**: Asynchronously monitors `HKCU\SOFTWARE\Valve\Steam\RunningAppID` to detect game state changes.
- **Process Management**: Uses `Toolhelp32` snapshotting to identify and terminate `steamwebhelper.exe` processes spawned by Steam.
- **Thread Safety**: Employs `Interlocked` atomic operations for race-condition-free initialization of the monitoring thread.
- **UI**: Provides a minimalist system tray icon for manual toggling and status feedback.

## Building and Pipeline
The project uses a modern CMake-based build system optimized for size and performance.

### Build Requirements
- **MSYS2** (UCRT64 environment)
- **LLVM/Clang** (preferred) or GCC
- **CMake** & **Ninja**

### Compilation Commands
```bash
# Configuration for maximum size optimization
cmake -S . -B build -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_BUILD_TYPE=MinSizeRel

# Build
cmake --build build
```
Output binary: `build/umpdc.dll`

### CI/CD Pipeline
- **Platform**: GitHub Actions (`.github/workflows/release.yml`)
- **Features**:
- **Validation**: Compiles the project on every Pull Request to `main`.
- **Deployment**: On version tags (`v*`), performs a production build using **LLVM/Clang 22**.
- **Immutability & Trust**: Generates **GitHub Artifact Attestations** (SLSA) for every release, ensuring cryptographic proof of provenance.

## Development Conventions
- **Minimalism**: Avoid C Standard Library (`nostdlib`). Use direct Win32/NT APIs.
- **Size Optimization**: Use aggressive compiler flags (`-Oz`, `-fno-stack-protector`, `-fno-asynchronous-unwind-tables`).
- **Nomenclature**: Use descriptive constants (defined in `Library.c`) instead of magic strings or numbers.
- **Safety**: Always close Handles and use atomic operations when managing shared state between the Main thread and the Registry Monitor thread.
- **Provenance**: All production binaries must be built through the CI pipeline to maintain "Immutable" status.
89 changes: 42 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,46 @@
> [!CAUTION]
> This project is now deprecated.

# NoSteamWebHelper
A program that disables Steam's CEF/Chromium Embedded Framework.
A high-performance utility that disables Steam's CEF (Chromium Embedded Framework) / Steam WebHelper while gaming.

## Aim
This program was created with the intent of replacing of Steam's command-line parameter `-no-browser` which was [removed.](https://steamcommunity.com/groups/SteamClientBeta/discussions/3/3710433479207750727/?ctp=42)


## How does NoSteamWebHelper kill or disable the CEF/Chromium Embedded Framework?

The dynamic link library toggles the CEF depending if an is app running or not.

- If an app is running then the CEF is disabled.

- If an app is not running then the CEF is enabled.

This way, Steam is still accessible to use.

# Usage
This program replaces Steam's removed `-no-browser` command-line parameter. It dynamically toggles the Steam WebHelper based on your activity to free up system resources without losing access to your library.

- **Game running**: Steam WebHelper is disabled (processes terminated and suppressed).
- **No game running**: Steam WebHelper is enabled (interface restored).

## Key Features & Refactoring (2026)
This project has been fully refactored for maximum performance and reliability:
- **Ultra-Lightweight**: Written in pure C with `nostdlib`. The resulting `umpdc.dll` is only a few KB.
- **Modern Build System**: Migrated to **CMake** with support for **LLVM/Clang 22** for state-of-the-art optimizations.
- **Zero-Leak Architecture**:
- Uses `Interlocked` atomic operations for thread-safe monitor initialization.
- Replaced `wtsapi32` dependency with `Toolhelp32` for better compatibility and smaller footprint.
- Asynchronous registry monitoring using Win32 Events to prevent UI/Hook freezes.
- **Immutable Releases**: Automated CI/CD pipeline via GitHub Actions with cryptographic build provenance (SLSA).

## Usage
1. Download the latest release from [GitHub Releases](https://github.com/Aetopia/NoSteamWebHelper/releases).

2. Place `umpdc.dll` in your Steam installation directory where `steam.exe` is located.

3. Make sure Steam is fully closed and launch a new instance of Steam.

4. Start up an app and the CEF will be toggled accordingly.

> [!NOTE]
> - You may also manually toggle the CEF via a tray icon.
> - To prevent the CEF from automatically showing when restored, pass `-silent` to Steam.

## Build
1. Install & update [MSYS2](https://www.msys2.org):

```bash
pacman -Syu --noconfirm
```

3. Install [GCC](https://gcc.gnu.org) & [MinHook](https://github.com/TsudaKageyu/minhook):

```bash
pacman -Syu mingw-w64-ucrt-x86_64-gcc --noconfirm
```


3. Start MSYS2's `UCRT64` environment & run `Build.cmd`.



2. Place `umpdc.dll` in your Steam installation directory (same folder as `steam.exe`).
3. Ensure Steam is fully closed, then launch Steam.
4. The CEF will now toggle automatically when you launch/close a game.

> [!TIP]
> - You can manually toggle the state via the tray icon.
> - Launch Steam with `-silent` to prevent the CEF from popping up unexpectedly when restored.

## Build from Source
The project uses **MSYS2** with the **UCRT64** environment.

1. **Install Prerequisites**:
```bash
pacman -Syu mingw-w64-ucrt-x86_64-clang mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-ninja
```

2. **Compile**:
```bash
cmake -S . -B build -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_BUILD_TYPE=MinSizeRel
cmake --build build
```
The optimized `umpdc.dll` will be located in the `build/` directory.

## CI/CD
This project uses GitHub Actions for automated builds. Every tagged release (`v*`) triggers a Clang-optimized build and generates a **Verified Provenance Attestation**, ensuring the binary's integrity.
Loading
Loading