Base64 Decoder and Link Wrapper for Rentry Pages

Decodes base64 encoded text and wraps it in an <a> tag on all Rentry pages

  1. // ==UserScript==
  2. // @name Base64 Decoder and Link Wrapper for Rentry Pages
  3. // @namespace http://tampermonkey.net/
  4. // @version 2025-02-23
  5. // @description Decodes base64 encoded text and wraps it in an <a> tag on all Rentry pages
  6. // @author You
  7. // @match https://rentry.co/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=rentry.co
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. let items = document.querySelectorAll("code");
  16. items.forEach((item) => {
  17. try {
  18. let decoded = atob(item.textContent);
  19. let link = document.createElement('a');
  20. link.href = decoded;
  21. link.textContent = decoded;
  22. item.parentNode.replaceChild(link, item);
  23. } catch (e) {
  24. console.warn('Invalid base64 content:', item.textContent);
  25. }
  26. });
  27.  
  28. })();