Adds mpris integration for certain sites using a Firefox Webextension.
It allows you to have proper media key support for webplayers like youtube and spotify.
The extension currently works with the following sites
- Spotify (open.spotify.com)
- Youtube (youtube.com)
The following software is required to use this project.
- A fairly recent version of firefox (anything above version 64.0 should be fine)
- glib, dbus (install using your package manager)
- Something to interact with mpris players (like playerctl or gnome shell)
- Install the webextension
- Compiled version at addons.mozilla.org
- Or compile it yourself (see below)
- Install the native host
- Compiled version from here.
- Or compile it yourself (see below)
- Add a native manifest file
- Copy the mpris_integration_native.json file to
~/.mozilla/native-messaging-hosts/
and replace thepath
key with the location of the native host binary.
- Copy the mpris_integration_native.json file to
If you're running Arch Linux, steps 2 and 3 can be replaced by installing the AUR package media-integration-native-host (not yet released).
In addition to the prerequisites above you will also need
- A copy of the source (clone this repo)
- web-ext
- rust and cargo (install using package manager or rustup)
- tsc (typescript compiler)
- In the add-on/ directory
- Run
tsc --build
to build the source typescript files into javascript, which is placed in theadd-on/dist
folder. - Run the
web-ext build
command. The build extension will be placed as a .zip inadd-on/web-ext-artifacts
. To install it, look here.
- Run
- Run
cargo build
(optionally with the--release
flag to make an optimized build). The binary will be placed intarget/{debug,release}
.
Don't forget to also add a native manifest file as described in the installation section.
This webextension and native host is licensed under the MIT license.
Icon made by Freepik from www.flaticon.com is licensed by CC 3.0 BY.