Spotify URL - Open to Desktop App

Modifies Spotify URLs to use the "spotify:" app handler and open the url to desktop app

  1. // ==UserScript==
  2. // @name Spotify URL - Open to Desktop App
  3. // @namespace http://your-namespace.example.com/
  4. // @version 1.0
  5. // @description Modifies Spotify URLs to use the "spotify:" app handler and open the url to desktop app
  6. // @match https://open.spotify.com/*
  7. // @grant none
  8.  
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. // Prepend "spotify:" to the URL
  15. var newUrl = 'spotify:' + window.location.href;
  16.  
  17. // Reload the page with the modified URL
  18. window.location.replace(newUrl);
  19.  
  20. // Close the tab (you may need to enable the "Tabs" permission for Tampermonkey)
  21. window.close();
  22. })();