Spotify song-name helper

Make craftwar's obs plugin (https://craftwarblog.blogspot.com/2018/01/obs-plugin-playing-song.html) able to get Spotify song name.

  1. // ==UserScript==
  2. // @author craftwar
  3. // @name Spotify song-name helper
  4. // @description Make craftwar's obs plugin (https://craftwarblog.blogspot.com/2018/01/obs-plugin-playing-song.html) able to get Spotify song name.
  5. // @copyright 2022, craftwar (https://craftwarblog.blogspot.com/)
  6. // @license GPL-3.0-or-later; https://www.gnu.org/licenses/gpl-3.0.txt
  7. // @homepageURL https://github.com/craftwar/userscript/tree/master/Spotify-song-name-helper
  8. // @version 0.1.20220830
  9. // @namespace github.com.craftwar
  10. // @match https://open.spotify.com/*
  11. // @grant none
  12. // @run-at document-end
  13. // @inject-into content
  14. // ==/UserScript==
  15. // inject-into content for Violentmonkey, default mode page is not working
  16. // ref: https://violentmonkey.github.io/2018/11/23/inject-into-context/
  17.  
  18. 'use strict';
  19. (() => {
  20. const title_element = document.querySelector("title");
  21. new MutationObserver(() => {
  22. if (!document.title.endsWith(" - YouTube"))
  23. document.title += " - YouTube";
  24. }).observe(title_element, { childList: true });
  25. })();

QingJ © 2025

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