Code Monkey home page Code Monkey logo

spotityspeedextension's Introduction

Spotity Speed Chrome Extension

Change the speed of spotify song playback rate. slow or fast.

preview img

Get it here: Chrome extension link

Version 1.5:

  • Added redundancy to ensure the extension loads

  • Spotify started randomly using and

  • added comments to the code


Install from github..

  • download project as zip preview img
  • unzip and load the folder as unpacked extension
  • remember to click that little refresh button on the extension page for the extension if you make code changes.

ℹ️ The code is in content-script.js and is heavily commented


The problem this solves:

The 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 allows a multilined string with double quotes and single quotes without breaking the string variable
  • This string named code is injected into the top of the html dom as a script element when the page loads

    • It loads before spotify's scripts and can pre-append the browser's code of document.createElement before it's used
    • Whenever spotify's scripts execute document.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 either
  • The 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

  • made a full copy of spotify's code
    • forced having to block spotify's script with a firewall extension
    • slow to open with editor and prone to crashing when debugging
    • firewall made things inconsistent
    • doesnt ever update when spotify updates :(
  • added window.spotifyContext = this; when you click play
    • this allowed window.spotifyContext._getTrackPlayer() from anywhere

spotityspeedextension's People

Contributors

intorfloat avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.