Strava - Hide from Feed (Mute)

Adds mute option to activity edit page.

  1. // ==UserScript==
  2. // @name Strava - Hide from Feed (Mute)
  3. // @namespace https://github.com/dtruebin/userscripts/
  4. // @supportURL https://github.com/dtruebin/userscripts/issues
  5. // @version 0.1
  6. // @description Adds mute option to activity edit page.
  7. // @author Dmitry Trubin
  8. // @match https://www.strava.com/activities/*/edit
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=strava.com
  10. // @grant none
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. (function () {
  15. 'use strict';
  16.  
  17. // As of 2023-08-18, muting only works one way: https://github.com/dtruebin/userscripts/issues/1
  18. const div = `
  19. <div class="form-group">
  20. <label>Hide from Home or Club Feeds</label>
  21. <ul class="hide-stats-container">
  22. <li>
  23. <input type="checkbox" value="1" name="activity[hide_from_home]" id="hide_from_home">
  24. <label for="hide_from_home">Mute activity</label>
  25. </li>
  26. </ul>
  27. </div>`
  28. document.querySelector('fieldset.activity-tags').insertAdjacentHTML('afterend', div)
  29. })();