Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save full Firefox profile #917

Merged
merged 2 commits into from
May 7, 2021
Merged

Save full Firefox profile #917

merged 2 commits into from
May 7, 2021

Conversation

boolean5
Copy link
Contributor

@boolean5 boolean5 commented May 7, 2021

This PR changes dump_profile so that it saves the whole Firefox profile directory instead of only saving a few of its subcomponents. It also adds a test and expands an existing one in order to test this new feature.

Closes #62.

boolean5 added 2 commits May 6, 2021 22:18
Save the whole Firefox profile directory instead of only saving a few of
its subcomponents. Remove an unused import of shutil from
profile_commands.py.

Additionally, remove the `extension_port.txt` file after reading the
port from it, to prevent reading stale port information when a browser
is restarted after a crash.

Finally, remove a part of the documentation that references the old way
of dumping the profile and update a leftover reference to the
`log_directory` config option.

Closes #62.
Add a test that checks that attempting to save an incomplete profile
raises an error. Also, extend `test_saving` to check that a few basic
files and directories of the Firefox profile are present in the archived
profile.
@codecov
Copy link

codecov bot commented May 7, 2021

Codecov Report

Merging #917 (e684e56) into master (dafc26c) will decrease coverage by 0.05%.
The diff coverage is 87.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #917      +/-   ##
==========================================
- Coverage   50.97%   50.91%   -0.06%     
==========================================
  Files          34       34              
  Lines        3398     3390       -8     
==========================================
- Hits         1732     1726       -6     
+ Misses       1666     1664       -2     
Impacted Files Coverage Δ
openwpm/browser_manager.py 71.35% <0.00%> (-0.19%) ⬇️
openwpm/commands/profile_commands.py 60.37% <100.00%> (-4.14%) ⬇️
openwpm/utilities/multiprocess_utils.py 54.76% <0.00%> (+4.76%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dafc26c...e684e56. Read the comment docs.

@boolean5 boolean5 requested a review from vringar May 7, 2021 10:26
"webappsstore.sqlite",
"prefs.js",
"bookmarkbackups",
"cache2",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see this file in my profile but since the tests are passing it must be some quirk in my setup I guess

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although I couldn't find this documented anywhere, after experimenting a little and reading the comments in https://stackoverflow.com/questions/25623705/selenium-retaining-firefox-cache-and-history-files, I concluded that when running Firefox with Selenium the browser cache is stored inside the profile, under the cache2 directory, while when running Firefox normally it is stored under ~/.cache/mozilla/firefox/xxxxx/cache2, where xxxxx is the same as the profile directory name.

@vringar vringar merged commit 889b54d into master May 7, 2021
@vringar vringar deleted the expand-profile branch May 7, 2021 11:33
Zaxeli pushed a commit to Zaxeli/OpenWPM that referenced this pull request Aug 10, 2021
* Save full Firefox profile

Save the whole Firefox profile directory instead of only saving a few of
its subcomponents. Remove an unused import of shutil from
profile_commands.py.

Additionally, remove the `extension_port.txt` file after reading the
port from it, to prevent reading stale port information when a browser
is restarted after a crash.

Finally, remove a part of the documentation that references the old way
of dumping the profile and update a leftover reference to the
`log_directory` config option.

Closes openwpm#62.

* Test saving full profile

Add a test that checks that attempting to save an incomplete profile
raises an error. Also, extend `test_saving` to check that a few basic
files and directories of the Firefox profile are present in the archived
profile.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expand saved Firefox profile to full directory
2 participants