AlternativeTo Download Button

Adds a download button to AlternativeTo.net listings

  1. // ==UserScript==
  2. // @name AlternativeTo Download Button
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Adds a download button to AlternativeTo.net listings
  6. // @author You
  7. // @match https://alternativeto.net/software/*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // Wait for the page to load
  16. window.addEventListener('load', function() {
  17. // Find the "Official Website" link
  18. const officialLink = document.querySelector('a[href*="://"]'); // Adjust selector if needed
  19. if (officialLink) {
  20. // Create a download button
  21. const downloadBtn = document.createElement('a');
  22. downloadBtn.href = officialLink.href; // Link to the official site
  23. downloadBtn.textContent = 'Download';
  24. downloadBtn.style.backgroundColor = '#4CAF50';
  25. downloadBtn.style.color = 'white';
  26. downloadBtn.style.padding = '8px 16px';
  27. downloadBtn.style.borderRadius = '4px';
  28. downloadBtn.style.marginLeft = '10px';
  29. downloadBtn.style.textDecoration = 'none';
  30.  
  31. // Insert the button next to the official link
  32. officialLink.parentNode.insertBefore(downloadBtn, officialLink.nextSibling);
  33. }
  34. });
  35. })();