npm install
Depending on the target browser, you need to build the extension for Manifest version 2 or 3.
This can be done with:
npm run-script watch
- where the extension will be built into the directorydist-mv2
npm run-script watch:mv3
- where the extension will be built into the directorydist-mv3
You can then follow the guide for how to load the extension into your browser of choice.
The project includes scripts for running the extension in Firefox and Chromium using the WebExtension tool for your convenience.
npm run-script watch
npm run-script start:firefox
By default start:chromium
will launch Google Chrome:
npm run-script watch:mv3
npm run-script start:chromium
To launch alternative Chromium browsers like Edge or Brave you can append the path to the binary suitable for your operating system:
This example is for launching Brave on MacOS
npm run-script start:chromium -- --chromium-binary /Applications/Brave\ Browser.app/Contents/MacOS/Brave\ Browser
Safari only supports web extensions bundled inside a native Mac app. If you are not building for development, Safari only loads web extensions if their containing apps are distributed via the Mac App Store, or if you select “Allow unsigned extensionsʺ from the Debug menu on each launch (requires authentication).
To build for development:
-
Build the extension for manifest version 2:
npm run build:mv2-safari
-
Update the project's marketing version from the manifest.
swift Rango/Build/UpdateRangoVersion.swift
-
Copy the template xcconfig to a user-specific one.
cp Rango/Build/UserSpecific{.template,}.xcconfig
-
Open the Rango project in Xcode.
xed Rango
-
Edit
Build
»UserSpecific.xcconfig
according to the comments in the file. -
Build and run the project.
-
Enable the extension in Safari’s Preferences.