openwpm.commands.profile_commands module¶
- class openwpm.commands.profile_commands.DumpProfileCommand(tar_path: Path, close_webdriver: bool, compress: bool = True)[source]¶
Bases:
BaseCommand
Dumps a browser profile currently stored in <browser_params.profile_path> to <tar_path>.
- execute(webdriver: WebDriver, browser_params: BrowserParamsInternal, manager_params: ManagerParamsInternal, extension_socket: ClientSocket) None [source]¶
This method gets called in the Browser process
- Parameters:
webdriver – WebDriver is a Selenium class used to control browser. You can simulate arbitrary interactions and extract almost all browser state with the tools that Selenium gives you
browser_params – Contains the per browser configuration E.g. which instruments are enabled
manager_params – Per crawl parameters E.g. where to store files
extension_socket –
Communication channel to the storage provider
TODO: Further document this once the StorageProvider PR has landed This allows you to send data to be persisted to storage.
- openwpm.commands.profile_commands.dump_profile(browser_profile_path: Path, tar_path: Path, compress: bool, browser_params: BrowserParamsInternal) None [source]¶
Dumps a browser profile to a tar file.
Should only be called when the browser is closed, to prevent database corruption in the archived profile (see section 1.2 of https://www.sqlite.org/howtocorrupt.html).
- openwpm.commands.profile_commands.load_profile(browser_profile_path: Path, browser_params: BrowserParamsInternal, tar_path: Path) None [source]¶
Loads a zipped cookie-based profile stored at <tar_path> and unzips it to <browser_profile_path>. The tar will remain unmodified.