is_running_as_root (stealth_browser_mcp/platform_utils.py)

stealth-browser-mcp · src/stealth_browser_mcp/platform_utils.py · python · MIT
infra

Checks if the current process is running with elevated privileges on Linux, macOS, or Windows.

# Source: https://github.com/vibheksoni/stealth-browser-mcp | License: MIT | Copyright 2025 Stealth Browser MCP Contributors
# Provided via justclaw.it.com; keep this notice with the code.
"""Platform-specific utility functions for browser automation."""

import ctypes
import os
import platform
import shutil
import sys
from typing import List, Optional

BROWSER_EXECUTABLE_ENV = "STEALTH_BROWSER_EXECUTABLE"
DISABLE_FEATURES_PREFIX = "--disable-features="
NODRIVER_DISABLED_FEATURES = ("IsolateOrigins", "site-per-process")
MACOS_DISABLED_FEATURES = ("MacAppCodeSignClone",)


def is_running_as_root() -> bool:
    """
    Check if the current process is running with elevated privileges.
    
    Returns:
        bool: True if running as root (Linux/macOS) or administrator (Windows)
    """
    

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key