The Firefox Add-On 'Live Stream Notifier' is currently not showing any live Twitch channels. Twitch changed it's API authentification method (see here), that's why many web extensions no longer have a simple way to access data from twitch. The maintainer of the Live Stream Notifier announced, that the extensive adaption to this API change will not happen in the near future. The extension will stay broken for some time.
We will (against Twitch's recommendations) aquire an application acces token and use it to access the API. This is not the correct flow for web extensions, but it is the simplest way to regain API access. Then we insert the token into the extension code, rebuild the xpi-package, and reinstall the modified extension.
- node
- git or download the repo from github
- email address for Twitch account verification
I tested this on Ubuntu 20.04 with Firefox 76.0.1 - 82.0.3 (64-bit). There seem to be problems with the build process on Windows. Also, check if your version of Firefox (Dev or Nightly) allows unsigned extensions (see step 4. and here).
- In the Live Stream Notifier Add On Preferences: Export configuration and back up the downloaded file.
- Remove the extension.
-
Register at Twitch's Dev Console. Preferably use a new account not linked to your Twitch channel.
-
Register a new fake application
Name
:<AnythingWhatever>
OAuth Redirect URLs
:http://localhost
Category
:Browser Extension
-
Generate and note down a
Client ID
andClient secret
-
Request an app acces token
POST https://id.twitch.tv/oauth2/token?client_id=<your client ID>&client_secret=<your client secret>&grant_type=client_credentials&scope=
Instructions here. Leave
scope
empty. Note: this is a POST request, don't paste it in the URL bar. Use the Firefox Dev Tools or curl. It will return anaccess_token
in JSON format. Note it down.
-
In a copy of your exported extension configuration from step 1.: Replace the
twitch_clientId
with yours. -
git clone https://github.com/freaktechnik/justintv-stream-notifications.git
-
In
src/background/providers/twitch.js
Line32
replace<your_access_token>
with e.g.h3h4ks829ud948f9hc9wskl
leaveClient-ID
empty:headers = { 'Client-ID': '', 'Authorization' : 'Bearer <your_access_token>' }
-
cd justintv-stream-notifications
-
npm ci
-
npm run build
-
Zip the contents of the
webextension
folder (not the folder itself). In the resulting zip should be nowebextension
subfolder.
- In Firefox navigate to
about:config
and setxpinstall.signatures.required
tofalse
. - In the Firefox Add-Ons Manager: Click the gear button and
Install Add-On from file
. Select your zip file. - Reimport the modified Live Stream Notifier configuration.
The application access token is only valid for a limited period of time (~60days). After that the token has to be renewed.
Disabling Firefox's extension signature verification is a security risk.
Twitch may not approve the missuse this authentication flow or ban your account.
Let me know where you got stuck. Maybe I forgot a step or made a mistake. Any feedback is welcome.
at the step
npm ci
it complains that there isn't apackage.json
. Is there a step missing or is my environment setup wrong or what?Thanks for the instructions btw!
And in the step
twitch.js
should we just copy paste what you have there or also replace Client-ID and your_access_token? I guess replace them?