browser-wakatime icon indicating copy to clipboard operation
browser-wakatime copied to clipboard

Building for Firefox - Working Instructions

Open erwin opened this issue 1 year ago • 0 comments

image

image

I had a bit of trouble getting this to build as the build, since the prerequisites don't match what any of my systems included.

https://github.com/wakatime/chrome-wakatime/blob/master/DEVELOPMENT.md#pre-requisites

For anyone else having trouble building, I would recommend giving this Docker based process a shot:

git clone https://github.com/wakatime/chrome-wakatime
cd chrome-wakatime

Create a ./Dockerfile with this content:

FROM node:11

COPY . /src

WORKDIR /src

RUN npm install -g @xarc/run-cli
RUN npm install
RUN npm start

Then run the Docker build

docker build . --tag chrome-wakatime

Then you just need to grab the files in /src/ (not /src/dist!!!) inside of the Docker image:

mkdir out
docker run -v $PWD/out:/out --rm -ti chrome-wakatime sh -c "cp -fvR /src/* /out"

Last in your URL bar, go to:

about:debugging#/runtime/this-firefox

Scroll down past your million open tabs, and down to

"Load Temporary Add-on..."

image

And browse for your ./out/manifest.json

WARNING: Do not use the ./out/dist/... file that you would assume you should use, as that file won't work right now and your build will not run, as RyanMulready pointed out in this comment: https://github.com/wakatime/chrome-wakatime/issues/49#issuecomment-849943747

Unfortunately, Firefox does not have a "developer mode".

Hopefully @alanhamlett can just post the working plugin to Firefox's Extensions repo, because it seems to work fine.

Until that happens, apparently it's possible to automatically re-install the extension each time you restart firefox...

https://github.com/tsaost/autoload-temporary-addon

erwin avatar Oct 13 '22 06:10 erwin