A browser extension for Perma.cc. Create and manage Perma links directly from the browser.
💾 Download it on the Chrome Web Store
flowchart RL
A[Service Worker]
B[(browser.storage.local)]
C[Popup UI<br>Custom Elements]
D[Perma.cc API]
A <--> B
B --> |onChanged events| C
C -.-> |Runtime Messages| A
D <--> |HTTP| A
browser.storage.local
- made available by the Web Extensions API - to persist data and monitor changes. handlers/onStorageUpdate
is executed every time storage is updated. It determines what was updated, and what part of the UI needs to be re-hydrated.npm install
to install dependencies.npm run dev
to start "development" mode. This effectively starts vite build --watch
, creating a new build under /dist
every time a file changes.chrome://extensions
dist
folder in perma-extension
./*html*/
to indicate that a JavaScript template string contains HTML. For VSCode users, we recommend the es6-string-html
extension to enable syntax highlighting in that context.The following environment variables are only used in the context of the test suites.
They may be provided using an .env
file, which the Playwright test runner will take into account.
Name | Context | Required | Description |
---|---|---|---|
TESTS_API_KEY |
Test suite | Yes | API key to be used for E2E tests. |
CI |
Test suite | No | Will alter test reporting if set (see playwright.config.js ). Used to run tests in a GitHub Action. |
Automatically-generated API documentation. Uses JSDoc comments.
npm run dev
Starts "development" mode. Effectively runs vite build --watch
, creating a new build under /dist
every time a file changes.
npm run build
Generates a new extension build under /dist
.
npm run build-and-zip
Generates a new extension build under /dist
and generates a zip from it (perma-extension.zip
).
npm run docgen
Generates documentation using JSDoc
comments. Outputs as Markdown to doc
.
To update which files should be taken into account, check /scripts/docgen.sh
.
npm run test
Runs the end-to-end tests suite using playwright.
Step-by-step:
develop
:
npm run docgen
)manifest.json
develop
and create a pull request from develop
to main
main
when tests passmain
branch:
main
branch2.0.1
)npm run build-and-zip
to generate perma-extension.zip
.perma-extension.zip
The E2E test suite is run via GitHub Action on:
develop
, main
main