Greasy Fork is available in English.

AO3 Hide Author's Notes

Hides all author's notes on AO3 works.

  1. // ==UserScript==
  2. // @name AO3 Hide Author's Notes
  3. // @namespace ao3-remove-authors-notes
  4. // @version 1.1
  5. // @description Hides all author's notes on AO3 works.
  6. // @author yuube
  7. // @match http*://*.archiveofourown.org/works/*
  8. // @match http*://*.archiveofourown.org/collections/*/works/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. // Work preface note.
  13. var preface = document.querySelector('#workskin .preface');
  14. var prefaceNote = preface.querySelector('.notes')
  15.  
  16. // If there are no gifts or other associations, hide whole preface note section.
  17. var associations = preface.querySelector('.associations')
  18. if (!associations && prefaceNote) {
  19. prefaceNote.style.display = 'none'
  20.  
  21. // Otherwise, just hide the author note.
  22. } else if (prefaceNote) {
  23. var userstuff = prefaceNote.querySelector('.userstuff')
  24. if (userstuff) {
  25. userstuff.style.display = 'none'
  26. }
  27.  
  28. // Also hide the jump to end notes.
  29. var jump = prefaceNote.querySelector('.jump')
  30. if (jump) {
  31. jump.style.display = 'none'
  32. }
  33. }
  34.  
  35. // If there's a work end note, hide it.
  36. var endNote = document.querySelector('#work_endnotes')
  37. if (endNote) {
  38. endNote.style.display = 'none'
  39. }
  40.  
  41. // For chapters, hide all note sections.
  42. var chapters = document.querySelector('#chapters');
  43. chapters.querySelectorAll('.notes').forEach(function (note) {
  44. note.style.display = 'none';
  45. });