For little HTML GUI applications, with easy Python/JS interop
—
Quality
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Browser-specific modules and functions for launching Eel applications in different browsers with custom configurations and platform-specific optimizations.
Set custom browser executable paths and retrieve configured paths.
# From eel.browsers module
def set_path(browser_name: str, path: str) -> None:
"""
Set custom browser executable path.
Parameters:
- browser_name: str - Browser identifier ('chrome', 'electron', 'edge', 'msie')
- path: str - Full path to browser executable
Returns:
None
"""
def get_path(browser_name: str) -> Optional[str]:
"""
Get configured browser executable path.
Parameters:
- browser_name: str - Browser identifier
Returns:
Optional[str] - Path to browser executable or None if not set
"""
def open(start_pages: Iterable[Union[str, Dict[str, str]]], options: OptionsDictT) -> None:
"""
Open pages in configured browser.
Parameters:
- start_pages: Iterable[Union[str, Dict[str, str]]] - Pages to open
- options: OptionsDictT - Browser and display options
Returns:
None
"""Usage Examples:
import eel
import eel.browsers
# Set custom Chrome path
eel.browsers.set_path('chrome', '/opt/google/chrome/chrome')
# Get configured path
chrome_path = eel.browsers.get_path('chrome')
print(f"Chrome path: {chrome_path}")
# Start with custom browser configuration
eel.init('web')
eel.start('index.html', mode='chrome')Auto-detection and launching of Chrome or Chromium browsers with app mode support.
# From eel.chrome module
name: str = 'Google Chrome/Chromium'
def run(path: str, options: OptionsDictT, start_urls: List[str]) -> None:
"""
Launch Chrome/Chromium with specified options.
Parameters:
- path: str - Path to Chrome executable
- options: OptionsDictT - Configuration options
- start_urls: List[str] - URLs to open
Returns:
None
"""
def find_path() -> Optional[str]:
"""
Auto-detect Chrome/Chromium executable path.
Returns:
Optional[str] - Path to Chrome executable or None if not found
"""Platform Detection:
Usage Example:
import eel
eel.init('web')
# Launch in Chrome app mode (default)
eel.start('app.html', mode='chrome', app_mode=True)
# Launch in Chrome regular mode
eel.start('app.html', mode='chrome', app_mode=False)
# Custom Chrome arguments
eel.start('app.html',
mode='chrome',
cmdline_args=['--start-fullscreen', '--disable-web-security'])Support for running Eel applications in Electron for enhanced desktop integration.
# From eel.electron module
name: str = 'Electron'
def run(path: str, options: OptionsDictT, start_urls: List[str]) -> None:
"""
Launch Electron with specified options.
Parameters:
- path: str - Path to Electron executable
- options: OptionsDictT - Configuration options
- start_urls: List[str] - URLs to open
Returns:
None
"""
def find_path() -> Optional[str]:
"""
Auto-detect Electron executable path.
Returns:
Optional[str] - Path to Electron executable or None if not found
"""Usage Example:
import eel
eel.init('web')
# Launch with Electron
eel.start('main.html', mode='electron')
# Custom Electron arguments
eel.start('app.html',
mode='electron',
cmdline_args=['--enable-logging'])Support for Microsoft Edge browser on Windows systems.
# From eel.edge module
name: str = 'Edge'
def run(_path: str, options: OptionsDictT, start_urls: List[str]) -> None:
"""
Launch Microsoft Edge with specified options.
Parameters:
- _path: str - Path parameter (unused for Edge)
- options: OptionsDictT - Configuration options
- start_urls: List[str] - URLs to open
Returns:
None
"""
def find_path() -> bool:
"""
Check if Microsoft Edge is available.
Returns:
bool - True if Edge is available (Windows only)
"""Usage Example:
import eel
eel.init('web')
# Launch with Edge
eel.start('index.html', mode='edge')
# Edge in app mode
eel.start('app.html', mode='edge', app_mode=True)Legacy support for Internet Explorer through Edge redirection.
# From eel.msIE module
name: str = 'MSIE'
def run(_path: str, options: OptionsDictT, start_urls: List[str]) -> None:
"""
Launch Internet Explorer (redirects to Edge).
Parameters:
- _path: str - Path parameter (unused)
- options: OptionsDictT - Configuration options
- start_urls: List[str] - URLs to open
Returns:
None
"""
def find_path() -> bool:
"""
Check if IE is available.
Returns:
bool - True if available (Windows only)
"""Use custom browser commands and configurations.
Usage Example:
import eel
eel.init('web')
# Custom browser command
eel.start('app.html',
mode='custom',
cmdline_args=['firefox', '--new-window'])
# No browser (server only)
eel.start('app.html', mode=False) # or mode=NoneAvailable browser modes for the mode parameter in eel.start():
'chrome' - Google Chrome/Chromium (default)'electron' - Electron framework'edge' - Microsoft Edge'msie' - Internet Explorer (legacy)'custom' - Custom browser command via cmdline_argsFalse or None - No browser (server only)# App mode (no browser UI)
eel.start('app.html', mode='chrome', app_mode=True)
# Regular browser mode (with address bar, etc.)
eel.start('app.html', mode='chrome', app_mode=False)# Chrome-specific flags
eel.start('app.html',
mode='chrome',
cmdline_args=[
'--disable-http-cache',
'--disable-web-security',
'--allow-running-insecure-content',
'--start-fullscreen'
])
# Electron-specific flags
eel.start('app.html',
mode='electron',
cmdline_args=['--enable-logging', '--remote-debugging-port=9222'])# Single window size and position
eel.start('main.html',
size=(1200, 800),
position=(100, 50))
# Per-page geometry
eel.start('main.html',
geometry={
'main.html': {'size': (1200, 800), 'position': (100, 50)},
'settings.html': {'size': (600, 400), 'position': (200, 100)}
})Install with Tessl CLI
npx tessl i tessl/pypi-eel