If an exception is raised in the synchronous api during the setup, super().__enter__ has been called but super().__exit__ will not get called, leading to asyncio runloop exceptions further down the line if one tries to create a new context. This commit catches the exception in order to clean up the super().__exit__ calls before reraising.
I'm deciding to keep Camoufox on FF135 for a bit until I can fully work out the new security changes in FF136 (that may require large-scale refactoring in Juggler).
- Moved environment variable parsing to a dedicated loadConfig() function, called only once during initialization of the global g_jsonConfig.
- Updated GetJson() to return the cached JSON object, preventing repetitive parsing of environment variables on each access.
- Improved performance and simplified configuration data access.
Replace <stdio.h> with <cstdlib> and <cstdio>
- Updated include directives to use modern C++ headers.
- The new headers place standard library functions in the std namespace, enhancing compatibility and type safety as recommended by modern C++ standards.
passing a proxy to camoufox with the "bypass"-argument while using geoip=True runs into an exception.
extending the class attributes fixes the problem on my local machine
A workaround to restore some original Playwright functionality.
Forces Playwright to run in "God mode", allowing it to bypass CORS restrictions, access shadow roots (with element.shadowRootUnl), access undocumented JS browser methods, modify DOM without `allowMainWorld`, & restore some unsupported Playwright functionality.
Note: `forceScopeAccess` is not detectable/visible to the page unless the dom is directly modified (elements are added or removed).