There are a few steps involved to build the extension from source and test it in your browser:
- Clone the repository
- Install dependencies by running
npm i
- Build a development version by running
npm run dev-build
- Open
chrome://extensions
in your Chromium-based browser - Activate developer mode on the extensions page
- Load the
dist/
directory from the repository folder as an unpacked extension
To pick up any subsequent changes you make to the code rerun the
npm run dev-build
command and reload the extension.
Every so often the extension will just stop working. This is mostly due to Spotify changing the layout of their website or changing the attributes on their HTML elements.
These issues are usually easy to fix. You should use the above instructions to get a local version running and then read the error message in the developer console of your browser.
It probably says something like Cannot read property '...' of null. Below the
error message there will be the stacktrace. Check out which method caused the
error and see if the call to document.querySelector
in there still works.
Update the selector if needed.
To publish a new release you have to follow a few steps:
-
Increase the version
Run
npm version patch
to increase the version in your package.json file and copy the new version to theversion
field inmanifest.json
. -
Create the extension bundle
Run the
npm run build
command to generate anupdate.zip
file in the root directory. -
Upload the new bundle
Now upload the new bundle to the Chrome Web Store and the Microsoft Edge-Add-Ons Store
The update will then be reviewed and be available within a few hours.