Skip to main content

Replacer

Replacer addons can be used to replace QRC resources at execution time. The addon must include all the required files in its bundle.

The JSON files are validated via JSON Schema files:

https://github.com/mozilla-mobile/mozilla-vpn-client/tree/main/scripts/ci/jsonSchemas

On this page, we want to describe how to write a replacer addon.

Considerations

  • Replacing QML files can be hazardous! The application will break if the QMLs are broken, or the dependencies are unsatisfied.

  • Replacing an entire folder is even more dangerous! Image what happens if you replace the whole i18n folder with broken translation files.

JSON format

The Replacer JSON files are addon JSON objects with the type "replacer" and a "replacer" property object with the following properties:

PropertyDescriptionTypeRequired
urlsAn array of Replace objectsArray of objectsYes

Replace object

This object must have the following structure:

PropertyDescriptionTypeRequired
requestThe QRC URL to be replacedstringYes
responseThe relative path of the file/directory to use to replace the requeststringYes
typeThe type of the request (file or directory). By default: filestringNo