Spotify open in app

This userscript redirects open.spotify.com links to the desktop app

< Σχολιασμός για τον κώδικα Spotify open in app

Αναφορά: Καλός - ο κώδικας λειτουργεί

§
Δημοσιεύτηκε: 31/07/2020

Updated script to include support for highlight in the URL.


(function() {
  'use strict';
  var url = new URL(document.URL);
  var uri;

  if (url.searchParams.get("highlight") === null) {
    data = url.pathname.match(/(track|playlist|album|artist|show|episode)\/([^\&\#\/\?]+)/i);
    uri = 'spotify:'+data[1]+':'+data[2];
  } else {
    uri = url.searchParams.get("highlight")
  }

  console.log("Redirecting to " + uri);
  window.location.replace(uri);
  window.close();
})();

Δημοσίευση απάντησης

Συνδεθείτε για να δημοσιεύσετε μια απάντηση.