AO3 Bookmark Back Button

Add a back button to the bookmark page on AO3

  1. // ==UserScript==
  2. // @name AO3 Bookmark Back Button
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @license MIT
  6. // @description Add a back button to the bookmark page on AO3
  7. // @author sunkitten_shash
  8. // @match http://archiveofourown.org/bookmarks/*
  9. // @match https://archiveofourown.org/bookmarks/*
  10. // @require https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. // add back button which redirects to the previous page
  18. function addButton() {
  19. $(".bookmarks-show > .navigation").prepend(`<li><a href="${document.referrer}" id="backButton">← Go Back</a></li>`);
  20. }
  21.  
  22. // when the bookmark page loads, add the button
  23. $(document).ready(addButton);
  24. })();