Delete Libby Amazon Button

Delete the Amazon checkout button from Libby

  1. // ==UserScript==
  2. // @name Delete Libby Amazon Button
  3. // @namespace https://github.com/sudo-nano
  4. // @version 2025-04-22
  5. // @description Delete the Amazon checkout button from Libby
  6. // @author sudo-nano
  7. // @match https://libbyapp.com/shelf/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. function waitForElement(callback) {
  14. // Initialize a mutation observer
  15. var observer = new MutationObserver(function(mutations, me) {
  16. // Query for the element
  17. var elements = document.getElementsByClassName('circ-option emph');
  18. var element = elements.item(1);
  19. if (element) {
  20. callback(element);
  21. // Once the element has been found, we can stop observing for mutations
  22. me.disconnect();
  23. return;
  24. }
  25. });
  26. // Start observing the document with the configured parameters
  27. observer.observe(document, { childList: true, subtree: true });
  28. }
  29.  
  30. function deleteElement(element) {
  31. element.remove()
  32. }
  33.  
  34. (function() {
  35. 'use strict';
  36. waitForElement(deleteElement);
  37. })();