-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(config): always enable extension
- Loading branch information
Showing
3 changed files
with
25 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,25 +98,24 @@ def deploy_firefox( | |
# because status_queue is read off no matter what. | ||
status_queue.put(("STATUS", "Display", (display_pid, display_port))) | ||
|
||
if browser_params.extension_enabled: | ||
# Write config file | ||
extension_config: Dict[str, Any] = dict() | ||
extension_config.update(browser_params.to_dict()) | ||
extension_config["logger_address"] = manager_params.logger_address | ||
extension_config["storage_controller_address"] = ( | ||
manager_params.storage_controller_address | ||
) | ||
extension_config["testing"] = manager_params.testing | ||
ext_config_file = browser_profile_path / "browser_params.json" | ||
with open(ext_config_file, "w") as f: | ||
json.dump(extension_config, f, cls=ConfigEncoder) | ||
logger.debug( | ||
"BROWSER %i: Saved extension config file to: %s" | ||
% (browser_params.browser_id, ext_config_file) | ||
) | ||
# Write config file | ||
extension_config: Dict[str, Any] = dict() | ||
extension_config.update(browser_params.to_dict()) | ||
extension_config["logger_address"] = manager_params.logger_address | ||
extension_config["storage_controller_address"] = ( | ||
manager_params.storage_controller_address | ||
) | ||
extension_config["testing"] = manager_params.testing | ||
ext_config_file = browser_profile_path / "browser_params.json" | ||
with open(ext_config_file, "w") as f: | ||
json.dump(extension_config, f, cls=ConfigEncoder) | ||
logger.debug( | ||
"BROWSER %i: Saved extension config file to: %s" | ||
% (browser_params.browser_id, ext_config_file) | ||
) | ||
|
||
# TODO restore detailed logging | ||
# fo.set_preference("[email protected]", "all") | ||
# TODO restore detailed logging | ||
# fo.set_preference("[email protected]", "all") | ||
|
||
# Configure privacy settings | ||
configure_firefox.privacy(browser_params, fo) | ||
|
@@ -153,15 +152,13 @@ def deploy_firefox( | |
), | ||
) | ||
|
||
# Add extension | ||
if browser_params.extension_enabled: | ||
# Install extension | ||
ext_loc = os.path.join(root_dir, "../../Extension/openwpm.xpi") | ||
ext_loc = os.path.normpath(ext_loc) | ||
driver.install_addon(ext_loc, temporary=True) | ||
logger.debug( | ||
"BROWSER %i: OpenWPM Firefox extension loaded" % browser_params.browser_id | ||
) | ||
# Install extension | ||
ext_loc = os.path.join(root_dir, "../../Extension/openwpm.xpi") | ||
ext_loc = os.path.normpath(ext_loc) | ||
driver.install_addon(ext_loc, temporary=True) | ||
logger.debug( | ||
"BROWSER %i: OpenWPM Firefox extension loaded" % browser_params.browser_id | ||
) | ||
|
||
# set window size | ||
driver.set_window_size(*DEFAULT_SCREEN_RES) | ||
|