SC: highlight hypeddits

highlight tracks with hypeddit or otherwise download/buy link

  1. // ==UserScript==
  2. // @name SC: highlight hypeddits
  3. // @namespace Violentmonkey Scripts
  4. // @match https://soundcloud.com/*
  5. // @grant none
  6. // @version 0.1.3
  7. // @author -
  8. // @description highlight tracks with hypeddit or otherwise download/buy link
  9. // @license GPLv3
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. function process(track) {
  16. const link = track.querySelector('a.soundActions__purchaseLink');
  17. if (!link) { return; }
  18. if (link.href.includes('hypeddit.com/')) {
  19. track.querySelector('a.sc-link-primary').style.background = '#f5d5eb';
  20. } else {
  21. track.querySelector('a.sc-link-primary').style.background = '#d5ebf5';
  22. }
  23. }
  24.  
  25. const observer = new MutationObserver(() => {
  26. document.querySelectorAll('div.sound__content').forEach(elm => process(elm) );
  27. });
  28. observer.observe(document.querySelector('#app'), { childList: true, subtree: true });
  29.  
  30.  
  31. })();

QingJ © 2025

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