Skip to content

Commit

Permalink
[py] Legacy Firefox driver: ensuring copy of profile dir, its 'extens…
Browse files Browse the repository at this point in the history
…ions' subdir and 'user.js' file are writable. Fixes #1466
  • Loading branch information
barancev committed Dec 3, 2017
1 parent 580edfa commit 9a6df49
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions py/selenium/webdriver/firefox/firefox_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,12 @@ def __init__(self, profile_directory=None):
shutil.copytree(self.profile_dir, newprof,
ignore=shutil.ignore_patterns("parent.lock", "lock", ".parentlock"))
self.profile_dir = newprof
os.chmod(self.profile_dir, 0o755)
self._read_existing_userjs(os.path.join(self.profile_dir, "user.js"))
self.extensionsDir = os.path.join(self.profile_dir, "extensions")
os.chmod(self.extensionsDir, 0o755)
self.userPrefs = os.path.join(self.profile_dir, "user.js")
os.chmod(self.userPrefs, 0o644)

# Public Methods
def set_preference(self, key, value):
Expand Down

0 comments on commit 9a6df49

Please sign in to comment.