Get it here: Chrome extension link
Added redundancy to ensure the extension loads
Spotify started randomly using
added comments to the code
download project as zip
unzip and load the folder as unpacked extension
content-script.js
and is heavily commentedThe video/audio element is hidden and only referenced in spotify's encapsulated code
This solution:
The code main part of the code is written in a template literal string with back quotes ---> `
This string named code is injected into the top of the html dom as a script element when the page loads
document.createElement
before it's useddocument.createElement('video')
a reference to the element created is stored in VideoElementsMade
document.createElement('video')
used to be an audio element until spotify started supporting videos and now it's randomly eitherThe timeout()
loop is just an added assurance that the playbackspeed input element is created and that the speed is changed to the stored speed from previous sessions
window.spotifyContext = this;
when you click play
window.spotifyContext._getTrackPlayer()
from anywhere