Open Spotify links in Desktop app

Include closing new spotify tab in browser

  1. // ==UserScript==
  2. // @name Open Spotify links in Desktop app
  3. // @namespace https://gf.qytechs.cn/ru/scripts/420536-open-spotify-links-in-desktop-app
  4. // @version 1.2
  5. // @description Include closing new spotify tab in browser
  6. // @author Sundear
  7. // @match https://open.spotify.com/*
  8. // @grant window.close
  9. // @run-at document-start
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. if (/track|playlist|album|artist|show|episode/gm.exec(window.location) !== null) {
  15. const meta = document.querySelector("meta[property='al:android:url']")
  16. if (meta) {
  17. const link = meta.getAttribute('content');
  18. if (link) {
  19. window.location.replace(link);
  20. window.close();
  21. }
  22. }
  23. }
  24. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址