Welcome! This guide will help you install and run the extension for development.
Clone and cd into the repository:
git clone https://github.com/david-tejada/rango.git
cd rango
Install dependencies:
npm install
The following command will build the extension for development and launch a Firefox instance using mozilla/web-ext.
npm run dev
You can also run the extension in Chrome. Note that in Chrome content scripts don't reload when the extension changes, so you need to refresh the page every time there is a change in the extension's code:
First build the extension in watch mode:
npm run watch:chrome
Then, in another terminal, run the extension:
npm run start:chrome
To launch alternative Chromium browsers like Edge or Brave you can use the flag
--chromium-binary
and append the path to the binary suitable for your
operating system:
# Launch Brave on MacOS
npm run start:chrome -- --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 Safari in watch mode:
npm run watch: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. -
At this point the files produced by the build process might not match the ones specified in
Rango/Rango for Safari.xcodeproj/project.pbxproj
. If that's the case some of them will be marked in red. In that case, in Xcode, select all the files insideShared (Extension)/Resources
and delete them (selectRemove References
when prompted). Then, right click onResources
and selectAdd Files to "Rango for Safari"
. Select all the files withindist/safari
. Make sure that onlyRango for Safari Extension (macOS)
is checked in theTargets
section. -
Build the project (
cmd-b
). -
Enable the extension in Safari’s Preferences.
-
After making changes to the extension, you need to run the build process again and refresh the page in Safari.