The Web eID extension for the Chrome, Edge and Firefox web browsers is built using the WebExtensions API, a cross-browser system for developing extensions. The extension communicates with the Web eID native application using Native messaging. Native messaging enables an extension to exchange messages with a native application installed on the user's computer to enable the extension to access resources that are not accessible through WebExtension APIs, like the smart card subsystem.
The Web eID extension for Safari is built as a Safari web extension. The source code of the Safari extension is in the web-eid-app GitHub repository, in the src/mac
subdirectory, as it uses native code written in Objective-C that links with web-eid-app code. The JavaScript layer of the Web eID Safari extension comes from the current WebExtension repository though. See the Safari extension overview in the web-eid-app README for more details.
-
Install the latest LTS version of Node.js - https://nodejs.org
-
Clone the project
git clone --recurse-submodules https://github.com/web-eid/web-eid-webextension.git
-
Install dependencies
cd web-eid-webextension npm install
-
Build the project with zip packages
npm run clean build package
For reproducible builds, set the
SOURCE_DATE_EPOCH
environment variable.
See https://reproducible-builds.org/docs/source-date-epoch for details.SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) npm run clean build package
Alternatively, for reproducible builds, the
SOURCE_DATE_EPOCH
value can be taken from theSOURCE_DATE_EPOCH
file of a previous build.SOURCE_DATE_EPOCH=$(cat ../previous-build/dist/firefox/SOURCE_DATE_EPOCH) npm run clean build package
For backwards compatibility with TokenSigning API, set the
TOKEN_SIGNING_BACKWARDS_COMPATIBILITY
environment variable totrue
.TOKEN_SIGNING_BACKWARDS_COMPATIBILITY=true npm run clean build package
During development, for additional logging, set the
DEBUG
environment variable totrue
.DEBUG=true npm run clean build package
-
Load in Firefox as a Temporary Extension
- Open
about:debugging#/runtime/this-firefox
- Click "Load temporary Add-on..." and open
/web-eid-webextension/dist/manifest.json
- Open
Make sure the NATIVE_APP_NAME
value in src/config.ts
matches the one in
the Web-eID native application manifest file.