Skip to content

Commit

Permalink
Only install certain exts in advance_setup mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jotyGill committed Sep 18, 2019
1 parent 1549a9b commit fe6dc68
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions privacyfighter/pf.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def setup_main_profile(firefox_path, profile_name, user_overrides_url, skip_exte
setup_myuserjs()

if not skip_extensions:
setup_extensions()
setup_extensions(advance_setup)
for profile in profiles:
# firefox profile path on the os
firefox_p_path = os.path.join(firefox_path, profile)
Expand Down Expand Up @@ -244,16 +244,18 @@ def resource_path(relative_path):
return os.path.join(base_path, relative_path)


def setup_extensions():
def setup_extensions(advance_setup):
# Download the extensions list with their download links from the repo
ext_list = get_file(
"https://raw.githubusercontent.com/jotyGill/privacy-fighter/master/privacyfighter/profile/extensions.json"
)
extensions = ext_list.json()["extensions"]

for index, ext in enumerate(extensions):
# only install some extensions in 'advance_setup' mode
if not advance_setup and ext["advance_setup"] == "True":
continue
print("Downloading {}".format(ext["name"]))

# Download and save extension.xpi files
extension_xpi = get_file(ext["url"])
open(os.path.join(extensions_folder, ext["id"]), "wb").write(extension_xpi.content)
Expand Down

0 comments on commit fe6dc68

Please sign in to comment.