Skip to content

link-foundation/browser-commander

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Browser Commander

A universal browser automation library with a unified API across multiple browser engines and programming languages. The key focus is on stoppable page triggers - ensuring automation logic is properly mounted/unmounted during page navigation.

Available Implementations

Language Package Status
JavaScript/TypeScript browser-commander npm
Rust browser-commander crates.io
Python browser-commander PyPI

Core Concept: Page State Machine

Browser Commander manages the browser as a state machine with two states:

+------------------+                      +------------------+
|                  |   navigation start   |                  |
|  WORKING STATE   | -------------------> |  LOADING STATE   |
|  (action runs)   |                      |  (wait only)     |
|                  |   <-----------------  |                  |
+------------------+     page ready       +------------------+

LOADING STATE: Page is loading. Only waiting/tracking operations are allowed. No automation logic runs.

WORKING STATE: Page is fully loaded (30 seconds of network idle). Page triggers can safely interact with DOM.

Page Trigger Lifecycle

The library provides a guarantee when navigation is detected:

  1. Action is signaled to stop (AbortController.abort())
  2. Wait for action to finish (up to 10 seconds for graceful cleanup)
  3. Only then start waiting for page load

This ensures:

  • No DOM operations on stale/loading pages
  • Actions can do proper cleanup (clear intervals, save state)
  • No race conditions between action and navigation

Getting Started

For installation and usage instructions, see the documentation for your preferred language:

Architecture

See js/src/ARCHITECTURE.md for detailed architecture documentation.

License

UNLICENSE

About

A library simplify control of local browsers to e2e testing

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •