This commit is contained in:
Маэстро автоматизации 2025-03-18 23:13:03 +02:00 committed by GitHub
commit c66607941f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 0 deletions

View file

@ -356,6 +356,7 @@ def launch_options(
ff_version: Optional[int] = None,
headless: Optional[bool] = None,
main_world_eval: Optional[bool] = None,
allow_addon_new_tab: Optional[bool] = None,
executable_path: Optional[Union[str, Path]] = None,
firefox_user_prefs: Optional[Dict[str, Any]] = None,
proxy: Optional[Dict[str, str]] = None,
@ -424,6 +425,8 @@ def launch_options(
main_world_eval (Optional[bool]):
Whether to enable running scripts in the main world.
To use this, prepend "mw:" to the script: page.evaluate("mw:" + script).
allow_addon_new_tab (Optional[bool]):
Whether to allow addon open new tabs. Defaults to False.
executable_path (Optional[Union[str, Path]]):
Custom Camoufox browser executable path.
firefox_user_prefs (Optional[Dict[str, Any]]):
@ -586,6 +589,10 @@ def launch_options(
if main_world_eval:
set_into(config, 'allowMainWorld', True)
# Allow addon open new tabs
if allow_addon_new_tab:
set_into(config, 'allowAddonNewtab', True)
# Set Firefox user preferences
if block_images:
LeakWarning.warn('block_images', i_know_what_im_doing)

View file

@ -297,6 +297,7 @@
"showcursor": "bool",
"allowMainWorld": "bool",
"allowAddonNewtab": "bool",
"forceScopeAccess": "bool",
"enableRemoteSubframes": "bool",
"disableTheming": "bool",

View file

@ -96,6 +96,7 @@
{ "property": "mediaDevices:speakers", "type": "uint" },
{ "property": "mediaDevices:enabled", "type": "bool" },
{ "property": "allowMainWorld", "type": "bool" },
{ "property": "allowAddonNewtab", "type": "bool" },
{ "property": "forceScopeAccess", "type": "bool" },
{ "property": "enableRemoteSubframes", "type": "bool" },
{ "property": "disableTheming", "type": "bool" },