Should re-use what every other automation tool uses - mozprofile (Python library).