Auto Load Preferences

Quickly load all of your preferred preferences by pressing CTRL + M

  1. // ==UserScript==
  2. // @name Auto Load Preferences
  3. // @namespace Ultrabox Scripts
  4. // @match https://ultraabox.github.io/
  5. // @match https://aurysystem.github.io/goldbox/
  6. // @match https://jummb.us/
  7. // @grant none
  8. // @version 1.0.1
  9. // @author PlanetBluto
  10. // @description Quickly load all of your preferred preferences by pressing CTRL + M
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. const SETTINGS = {
  15. autoPlay: false,
  16. // autoFollow: false,
  17. enableNotePreview: true,
  18. showLetters: true,
  19. showFifth: true,
  20. notesOutsideScale: false,
  21. setDefaultScale: true,
  22. showChannels: true,
  23. showScrollBar: true,
  24. alwaysFineNoteVol: true,
  25. enableChannelMuting: true,
  26. displayBrowserUrl: true,
  27. displayVolumeBar: true,
  28. showOscilloscope: true,
  29. showSampleLoadingStatus: true
  30. }
  31.  
  32. const print = console.log
  33.  
  34. var inited = false
  35.  
  36. var toggleFunc = (elem, key) => {
  37. elem.value = key
  38. elem.dispatchEvent(new Event("change"))
  39.  
  40. print(`${key}: `, localStorage.getItem(key))
  41. }
  42.  
  43. var int = setInterval(() => {
  44. var selectElem = document.querySelector(".selectContainer.menu.preferences > select")
  45. if (selectElem) {
  46. clearInterval(int)
  47.  
  48. document.addEventListener("keydown", e => {
  49. if (e.which == 77 && e.ctrlKey) {
  50. Object.keys(SETTINGS).forEach(key => {
  51. localStorage.setItem(key, `${SETTINGS[key]}`)
  52. })
  53.  
  54. location.reload()
  55. }
  56. })
  57. }
  58. }, 10)