Skip to content

Latest commit

 

History

History

firefox-ios

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Firefox for iOS

This is the subdirectory that contains the Firefox for iOS application.

Main branch

Firefox for iOS works with Xcode 16.1, Swift 5.6 and supports iOS 15.0 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.
  2. Install, Brew, Node, and a Python3 virtualenv for localization scripts:
    brew update
    brew install node
    pip3 install virtualenv
  3. Clone the repository:
    git clone https://github.com/mozilla-mobile/firefox-ios
  4. Change directories to the project root:
    cd firefox-ios
  5. From the project root, install Node.js dependencies, build user scripts and update content blocker:
    sh ./bootstrap.sh
  6. Open the Client.xcodeproj under the firefox-ios folder in Xcode.
  7. Make sure to select the Fennec scheme in Xcode.
  8. Select the destination device you want to build on.
  9. 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:

/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 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