diff --git a/pythonlib/camoufox/utils.py b/pythonlib/camoufox/utils.py index 7158ba8..786ccac 100644 --- a/pythonlib/camoufox/utils.py +++ b/pythonlib/camoufox/utils.py @@ -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) diff --git a/settings/camoucfg.jvv b/settings/camoucfg.jvv index 7791fe9..36ab26b 100644 --- a/settings/camoucfg.jvv +++ b/settings/camoucfg.jvv @@ -297,6 +297,7 @@ "showcursor": "bool", "allowMainWorld": "bool", + "allowAddonNewtab": "bool", "forceScopeAccess": "bool", "enableRemoteSubframes": "bool", "disableTheming": "bool", diff --git a/settings/properties.json b/settings/properties.json index 0c2fe36..423c11d 100644 --- a/settings/properties.json +++ b/settings/properties.json @@ -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" },