Skip to content

Commit bd5d3c0

Browse files
committedMar 24, 2025
Formatted the project
1 parent 53eeb4e commit bd5d3c0

File tree

2 files changed

+56
-52
lines changed

2 files changed

+56
-52
lines changed
 

‎scripts/update_newtab.py

+55-51
Original file line numberDiff line numberDiff line change
@@ -12,62 +12,66 @@
1212
NPM_INSTALL_COMMANDS = ["npm install", "npm install meow@9.0.0"]
1313
BUNDLE_COMMAND = "npm run bundle --prefix=browser/components/newtab"
1414

15+
1516
def install_dependencies():
16-
if not os.path.isdir(NEW_TAB_DIR):
17-
logging.error(f"Directory not found: {NEW_TAB_DIR}")
18-
raise FileNotFoundError(f"New tab directory {NEW_TAB_DIR} does not exist")
19-
20-
for command in NPM_INSTALL_COMMANDS:
21-
try:
22-
logging.info(f"Running command: {command} in {NEW_TAB_DIR}")
23-
subprocess.run(
24-
command.split(),
25-
cwd=NEW_TAB_DIR,
26-
check=True,
27-
capture_output=True,
28-
text=True
29-
)
30-
logging.info(f"Successfully executed: {command}")
31-
except subprocess.CalledProcessError as e:
32-
logging.error(f"Command failed: {command} - {e.stderr}")
33-
raise
17+
if not os.path.isdir(NEW_TAB_DIR):
18+
logging.error(f"Directory not found: {NEW_TAB_DIR}")
19+
raise FileNotFoundError(f"New tab directory {NEW_TAB_DIR} does not exist")
3420

35-
def bundle_newtab_components():
36-
if not os.path.isdir(ENGINE_DIR):
37-
logging.error(f"Directory not found: {ENGINE_DIR}")
38-
raise FileNotFoundError(f"Engine directory {ENGINE_DIR} does not exist")
39-
21+
for command in NPM_INSTALL_COMMANDS:
4022
try:
41-
logging.info(f"Bundling newtab components in {ENGINE_DIR}")
42-
result = subprocess.run(
43-
BUNDLE_COMMAND.split(),
44-
cwd=ENGINE_DIR,
45-
check=True,
46-
capture_output=True,
47-
text=True
48-
)
49-
logging.info(f"Bundle completed successfully: {result.stdout}")
23+
logging.info(f"Running command: {command} in {NEW_TAB_DIR}")
24+
subprocess.run(
25+
command.split(),
26+
cwd=NEW_TAB_DIR,
27+
check=True,
28+
capture_output=True,
29+
text=True
30+
)
31+
logging.info(f"Successfully executed: {command}")
5032
except subprocess.CalledProcessError as e:
51-
logging.error(f"Bundle failed: {e.stderr}")
52-
raise
33+
logging.error(f"Command failed: {command} - {e.stderr}")
34+
raise
35+
36+
37+
def bundle_newtab_components():
38+
if not os.path.isdir(ENGINE_DIR):
39+
logging.error(f"Directory not found: {ENGINE_DIR}")
40+
raise FileNotFoundError(f"Engine directory {ENGINE_DIR} does not exist")
41+
42+
try:
43+
logging.info(f"Bundling newtab components in {ENGINE_DIR}")
44+
result = subprocess.run(
45+
BUNDLE_COMMAND.split(),
46+
cwd=ENGINE_DIR,
47+
check=True,
48+
capture_output=True,
49+
text=True
50+
)
51+
logging.info(f"Bundle completed successfully: {result.stdout}")
52+
except subprocess.CalledProcessError as e:
53+
logging.error(f"Bundle failed: {e.stderr}")
54+
raise
55+
5356

5457
def update_newtab(init: bool = True):
55-
try:
56-
if init:
57-
logging.info("Starting dependency installation")
58-
install_dependencies()
59-
logging.info("Dependencies installed successfully")
60-
61-
logging.info("Starting bundle process")
62-
bundle_newtab_components()
63-
logging.info("Newtab update completed successfully")
64-
65-
except (subprocess.CalledProcessError, FileNotFoundError) as e:
66-
logging.error(f"Update process failed: {str(e)}")
67-
raise
68-
except Exception as e:
69-
logging.error(f"Unexpected error: {str(e)}")
70-
raise
58+
try:
59+
if init:
60+
logging.info("Starting dependency installation")
61+
install_dependencies()
62+
logging.info("Dependencies installed successfully")
63+
64+
logging.info("Starting bundle process")
65+
bundle_newtab_components()
66+
logging.info("Newtab update completed successfully")
67+
68+
except (subprocess.CalledProcessError, FileNotFoundError) as e:
69+
logging.error(f"Update process failed: {str(e)}")
70+
raise
71+
except Exception as e:
72+
logging.error(f"Unexpected error: {str(e)}")
73+
raise
74+
7175

7276
if __name__ == "__main__":
73-
update_newtab(init=False)
77+
update_newtab(init=False)

‎src/browser/app/profile/zen-browser.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ pref('browser.migrate.opera.enabled', true);
256256
// pref('network.trr.mode', 5);
257257

258258
// security: They must enable this themselves, to avoid people downloading malware
259-
pref('xpinstall.signatures.required', false);
259+
pref('xpinstall.signatures.required', true);
260260

261261
// Experimental Zen Features
262262
// Strategy to use for bytecode cache (Thanks https://github.com/gunir)

0 commit comments

Comments
 (0)
Failed to load comments.