Mastodon Streamer Mode

Hide Private or Direct posting from Mastodon timeline

  1. // ==UserScript==
  2. // @name Mastodon Streamer Mode
  3. // @namespace me.nzws.us.mastodon-streamer-mode
  4. // @version 1.0.0
  5. // @description Hide Private or Direct posting from Mastodon timeline
  6. // @author nzws
  7. // @match https://don.nzws.me/*
  8. // @match https://mstdn.jp/*
  9. // @match https://mastodon.cloud/*
  10. // @match https://pawoo.net/*
  11. // @match https://best-friends.chat/*
  12. // @grant none
  13. // ==/UserScript==
  14.  
  15. const css = document.createElement('style');
  16. css.innerHTML = `
  17. .status__wrapper-private, .status__wrapper-direct {
  18. display: none
  19. }
  20. `;
  21. document.head.appendChild(css);
  22.  
  23. window.onload = () => {
  24. 'use strict';
  25. const mastodon = document.querySelector('.app-body #mastodon');
  26. if (!mastodon) return;
  27.  
  28. const composeForm = document.querySelector('.compose-form');
  29. const div = document.createElement('div');
  30. div.textContent = 'Streamer Mode is Enabled';
  31. div.style.margin = '5px 0';
  32. div.style.padding = '5px 0';
  33. div.style.background = 'purple';
  34. div.style.color = 'white';
  35. div.style.textAlign = 'center';
  36.  
  37. composeForm.appendChild(div);
  38. };