async def create_context(self, 
                           viewport: dict = {"width": 2560, "height": 1440},
                           user_agent: str = None) -> BrowserContext:
        """Create optimized browser context with human-like settings"""
        if not self._browser:
            raise RuntimeError("Browser not connected. Call connect_to_chrome first.")

        # Return existing context if it exists
        if self._context:
            return self._context

        # Create new context with optimized settings
        self._context = await self._browser.new_context(
            viewport=viewport,
            user_agent=user_agent or self._modern_user_agent(),
            locale="en-US",
            timezone_id="America/New_York",
            permissions=["geolocation"],
            geolocation={"latitude": 40.7128, "longitude": -74.0060},  # NYC
            http_credentials=None,
            proxy=self._proxy_settings(),
            color_scheme="light",
        )

        await self._add_anti_detection()
        await self._configure_network()
        return self._context
Create optimized browser context with human-like settings
backend/Browser/webrover_browser.py