Is everyone sending you links from Apple Music? Here’s a userscript for Greasemonkey/Tampermonkey that adds Spotify links to iTunes album and artist pages.
Tested in Chrome Tampermonkey and Firefox Greasemonkey. Currently broken in Safari Tampermonkey due to a combination of Apple adding CSP rules to their iTunes pages and Safari ignoring the CSP spec 🙁
Important changes in v4.0
- Due to recent changes in the Spotify API authentication rules, search calls now require client credentials. Unfortunately, this means your searches must be sent through my server to make API calls on your behalf. If you have privacy concerns, you can use your own credentials and bypass my server (see “Options” section below).
- The embedded Spotify player had to be removed due to Content Security Policy restrictions that were added in the Apple Music redesign.
- If you want the Spotify link to open in the Web Player instead of the desktop app, look for the
open_in_appvariable at the top of the script and set it to
- If you want to use your own credentials to communicate with the Spotify API directly, first register an application with Spotify. Set up your Client ID and Secret in the “User preferences (advanced)” section at the top of the script.
- When multiple matches are found in the Spotify catalog, the first one will be used.
- The script will try to work across different locales, but may fail to find a match when the album/artist name on the iTunes page is in an alternative language, like the Chinese
Aerosmith. This is a limitation of the Spotify search API. Japanese queries seem to work most of the time, but not always.
- The search API may have trouble finding a match due to minor naming discrepancies. If you suspect this is the case, you can always look for it manually on Spotify.
v4.0.1 — 2017/10/29
- Minor fixes for design changes
v4.0 — 2017/06/08
- Fix for changes in Spotify API authentication rules
- Fix for new Apple Music page design
- Remove player embedding (now impossible due to Content Security Policy restrictions by Apple)
- Make Spotify button a search link when no match found
v3.0 — 2017/01/29
- Vastly improve album matching (Will now handle the majority of naming inconsistencies, including live albums and deluxe editions. Also tries fuzzier search queries for better matching of classical music and soundtracks. Sorry for the occasional false positives.)
v2.0 — 2016/11/04
- Add option to embed Spotify player on album pages