Apple Music(embed) - Hide Overlay

Apple Music(embed) - Hide Overlay.

  1. // ==UserScript==
  2. // @name Apple Music(embed) - Hide Overlay
  3. // @description Apple Music(embed) - Hide Overlay.
  4. // @version 0.2
  5. // @author to
  6. // @namespace https://github.com/to
  7. // @license MIT
  8. //
  9. // @match https://embed.music.apple.com/*
  10. // @icon https://www.google.com/s2/favicons?sz=64&domain=music.apple.com
  11. // ==/UserScript==
  12.  
  13. const css = `
  14. embed-upsell-overlay {
  15. display: none !important;
  16. }
  17.  
  18. .container-player {
  19. height: 100vh !important;
  20. }`;
  21.  
  22. const root = document.querySelector('embed-root');
  23. const observer = new MutationObserver(() => {
  24. if (!root.shadowRoot)
  25. return;
  26.  
  27. root.shadowRoot.appendChild(createStyle(css));
  28. observer.disconnect();
  29. });
  30. observer.observe(root, {
  31. attributes: true,
  32. });
  33.  
  34. function createStyle(css) {
  35. var style = document.createElement('style');
  36. style.setAttribute('type', 'text/css');
  37. style.appendChild(document.createTextNode(css));
  38. return style;
  39. }

QingJ © 2025

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