Skip to content

Commit 4190f22

Browse files
authored
Merge pull request #244 from willrossignol/patching-instructions
2 parents fbc8e1b + a0c4750 commit 4190f22

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

content/docs/contribute/desktop/code-structure-and-prefs.mdx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,21 @@ The Zen Browser is a fork of Firefox with custom features like vertical tabs, wo
1515
- **src/browser/**: Browser components with patches (e.g., browser.xhtml patches).
1616
- **prefs/**: Preference files in YAML format for various features (e.g., zen.yaml for general prefs, glance.yaml for glance feature).
1717

18+
## How to Patch the Firefox Source Code
19+
You can create patches on the Firefox source code by modifying the files in the `engine/` directory which is created after you've run the `npm run init` command.
20+
21+
### Steps to Make Changes on the Firefox Source Code
22+
1. **Find the file you want to modify**
23+
- You can easily navigate the Firefox source code using Mozilla's [Searchfox](https://searchfox.org/) tool
24+
- Modify the file in the `engine/` directory
25+
26+
2. **Patch the file and import the changes**
27+
- Run `npm run export <path>`
28+
- Run `npm run import`
29+
30+
3. **Build and Test**
31+
- Rebuild the browser
32+
1833
## How to Add New Preferences
1934
Preferences in Zen Browser are defined in YAML files under `prefs/`. These are loaded and applied to customize behavior.
2035

@@ -53,4 +68,8 @@ To add a pref for enabling/disabling the Glance feature:
5368

5469
<Callout type="info" title="Tip">
5570
For more details, refer to existing preference definitions in the `prefs/` directory and their corresponding code implementations in `src/zen/`.
56-
</Callout>
71+
</Callout>
72+
73+
## Additional Resources
74+
75+
- [Firefox Source Docs](https://firefox-source-docs.mozilla.org)

0 commit comments

Comments
 (0)