notion-audio-loop

Search all the audio element on the notion page, and set the "loop" attribute to true.

  1. // ==UserScript==
  2. // @name notion-audio-loop
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Search all the audio element on the notion page, and set the "loop" attribute to true.
  6. // @author You
  7. // @match https://www.notion.so/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=notion.so
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13.  
  14. //check every 300ms
  15. //if we found any audio element, set the lop attribute to true
  16. const intervalID = setInterval(_ => {
  17. var x = document.querySelectorAll("audio");
  18.  
  19. for(var i = 0; i < x.length; i++){
  20. if(x[i].loop != true){
  21. console.log("Set audio's loop attribute to true");
  22. x[i].loop = true;
  23. //let the user know that the loop is actived (can be tell from the appearance)
  24. x[i].style.width = "95%";
  25. }
  26. }
  27. }, 300);

QingJ © 2025

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