Revision control

Copy as Markdown

# Firefox for iOS
This is the subdirectory that contains the Firefox for iOS application.
## Main branch
Firefox for iOS works with [Xcode 15.2](, Swift 5.8 and supports iOS 17.2 and above.
Please make sure you aim your pull requests in the right direction.
For bug fixes and features for a specific release, use the version branch.
## Getting Involved
See readme at the root of the project for [the guidelines]( on how to contribute to this project.
## Building the code
1. Install the latest [Xcode developer tools]( from Apple.
1. Install, [Brew](, Node, and a Python3 virtualenv for localization scripts:
brew update
brew install node
pip3 install virtualenv
1. Clone the repository:
1. Install Node.js dependencies, build user scripts and update content blocker:
cd firefox-ios
sh ./
1. Open the `Client.xcodeproj` under the `firefox-ios` folder in Xcode.
1. Make sure to select the `Fennec` [scheme]( in Xcode.
1. Select the destination device you want to build on.
1. Run the app with `Cmd + R` or by pressing the `build and run` button.
⚠️ Important: In case you have dependencies issues with SPM, please try the following:
- Xcode -> File -> Packages -> Reset Package Caches
## Building User Scripts
User Scripts (JavaScript injected into the `WKWebView`) are compiled, concatenated, and minified using [webpack]( User Scripts to be aggregated are placed in the following directories:
|-- /Frontend
|-- /UserContent
|-- /UserScripts
|-- /AllFrames
| |-- /AtDocumentEnd
| |-- /AtDocumentStart
|-- /MainFrame
|-- /AtDocumentEnd
|-- /AtDocumentStart
This reduces the total possible number of User Scripts down to four. The compiled output from concatenating and minifying the User Scripts placed in these folders resides in `/Client/Assets` and are named accordingly:
* `AllFramesAtDocumentEnd.js`
* `AllFramesAtDocumentStart.js`
* `MainFrameAtDocumentEnd.js`
* `MainFrameAtDocumentStart.js`
To simplify the build process, these compiled files are checked-in to this repository.
To start a watcher that will compile the User Scripts on save, run the following `npm` command in the root directory of the project:
npm run dev
⚠️ Note: `npm run dev` will build the JS bundles in development mode with source maps, which allows tracking down lines in the source code for debugging.
To create a production build of the User Scripts run the following `npm` command in the root directory of the project:
npm run build