AO3 Hide Author's Notes

Hides all author's notes on AO3 works.

当前为 2019-08-30 提交的版本,查看 最新版本

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