fix: add allow_addon_new_tab launch option

This commit is contained in:
Aleksandr
2025-03-18 22:53:17 +02:00
committed by Jake Writer
parent c4716d2ec1
commit d5d7713684
3 changed files with 9 additions and 0 deletions
+7
View File
@@ -486,6 +486,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,
browser: Optional[str] = None,
firefox_user_prefs: Optional[Dict[str, Any]] = None,
@@ -562,6 +563,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.
browser (Optional[str]):
@@ -803,6 +806,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)