mirror of
https://github.com/daijro/camoufox.git
synced 2026-08-21 08:01:06 +00:00
fix: add allow_addon_new_tab launch option
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user