This is the subdirectory that contains the Firefox for iOS application.
For details on compatible Xcode and Swift versions used to build this project, as well as the minimum iOS version, refer to the root README.
For information on how to contribute to this project, including communication channels, coding style, PR naming guidelines and more, visit the Contribution guidelines.
- Install the version of Xcode from Apple that matches what this project uses, as listed in the root README.
- Install, Brew, Node, and a Python3 virtualenv for localization scripts:
brew update brew install node
- Clone the repository:
git clone https://github.com/mozilla-mobile/firefox-ios
- Change directories to the project root:
cd firefox-ios - From the project root, install Node.js dependencies, build user scripts and update content blocker:
sh ./bootstrap.sh
- Open the
Client.xcodeprojunder thefirefox-iosfolder in Xcode. - Make sure to select the
Fennecscheme in Xcode. - Select the destination device you want to build on.
- Run the app with
Cmd + Ror by pressing thebuild and runbutton.
- Xcode -> File -> Packages -> Reset Package Caches
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:
/Client
|-- /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 is named accordingly:
AllFramesAtDocumentEnd.jsAllFramesAtDocumentStart.jsMainFrameAtDocumentEnd.jsMainFrameAtDocumentStart.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 devnpm 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