Skip to content

Latest commit

 

History

History
193 lines (129 loc) · 4.84 KB

File metadata and controls

193 lines (129 loc) · 4.84 KB

Contributing

For workflow instructions, see the main CSSNR CONTRIBUTING.md.

To set local master as legacy

It is easier to delete and re-clone the repository; however, if you want to avoid doing that:

git branch -m master legacy
git fetch origin
git branch -u origin/legacy legacy
git remote set-head origin -a
git remote prune origin
git checkout master

Application

To get started clone the project and install the dependencies.

npm install

Developing

Note: WXT launches a browser by default when you run dev. See Browser Opening modify the browser or disable this behavior.

Chrome

npm run dev

To Load Manually, open Chrome and navigate to chrome://extensions/, enable "Developer mode", and load the unpacked extension from the .output directory.

Firefox

npm run dev:ff

To Load Manually, open Firefox and navigate to about:debugging#/runtime/this-firefox, then click "Load Temporary Add-on..." and load the unpacked extension from the .output directory.

Android

This requires the Android Debug Bridge (adb).

In another terminal (or without the watcher run npm build:ff).

npm run watch:ff

Enable USB or Wireless Debugging, connect, and get your device name.

adb devices

Then run using your device name.

npm run android -- name

Building

Package All

This type checks the project, builds and zips to the .output directory.

npm run package

Chrome

To build the .output directory.

npm run build

To build and create an archive in the .output directory.

npm run zip:chrome

Firefox

To build the .output directory.

npm build:ff

To build and create an archive in the .output directory.

npm run zip:ff

WXT

This project uses the WXT framework.

Browser Opening

To customize the config for development add a web-ext.config.ts to the project root.

The binaries allow you to pick which browser opens. To disable auto-opening set disabled: true.

// web-ext.config.ts
import { defineWebExtConfig } from 'wxt'

export default defineWebExtConfig({
  binaries: {
    firefox: 'C:/Program Files/Firefox Developer Edition/firefox.exe',
    chrome: 'C:/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe',
  },
  // disabled: true,
})

Loading Unpacked

Additional notes on loading temporary/unpacked extensions.

Locales

To add a new locale:

  1. The source language is English, copy en.yaml
  2. Copy the exact format, including comments.
  3. Verify the correct file name: https://developer.chrome.com/docs/extensions/reference/api/i18n
  4. Verify the correct Mozilla name in PROD_LANGUAGES: https://github.com/mozilla/addons-server/blob/master/src/olympia/core/languages.py
  5. Add the Release Notes translation here release.yaml

Note: The process for adding and validating names for Mozilla was clearly designed by a foolish child.

Documentation

The docs are built using VitePress and deployed to GitHub Pages.

To get started, clone the repository and run.

npm i
npm run docs:dev

The site should now be available at: http://localhost:5173/

To generate an up-to-date contributors.json run.

npm run get-contributors

For more details about VitePress see.

Location Description
docs Documentation Root (Markdown files).
docs/public Static Root (copied to docs root).
docs/.vitepress VitePress Configuration Root.
docs/.vitepress/config.mts VitePress Configuration File.