LibraryThing profile tab

Adds a "Profile" tab next to the "Home" tab, like the old LT used to have

  1. // ==UserScript==
  2. // @name LibraryThing profile tab
  3. // @namespace https://greasyfork.org/en/users/11592-max-starkenburg
  4. // @description Adds a "Profile" tab next to the "Home" tab, like the old LT used to have
  5. // @include http*://*librarything.tld/*
  6. // @include http*://*librarything.com/*
  7. // @version 3
  8. // @license public domain
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. var yourBooksTab = document.getElementById("masttab_books");
  13.  
  14. if (yourBooksTab) { // It's not there if you're logged out
  15.  
  16. var profileTab = yourBooksTab.cloneNode(true);
  17.  
  18. profileTab.id = "masttab_profile";
  19. profileTab.className = "sitenav_item g2"; // So that it doesn't get "selected" if you're on the catalog. Not sure what "g2" is for, but leaving it in anyway.
  20. profileTab.href = profileTab.href.replace("/catalog/","/profile/");
  21. profileTab.textContent = "Profile";
  22. yourBooksTab.parentNode.insertBefore(profileTab, yourBooksTab);
  23. }