// ==UserScript== // @name FMHY Base64 Rentry Decoder-Linkifier // @version 1.0 // @description Decode base64-encoded the FMHY Rentry page and make URLs clickable // @match https://rentry.co/fmhybase64* // @match https://rentry.co/FMHYBase64* // @grant none // @namespace https://greasyfork.org/users/980489 // @downloadURL none // ==/UserScript== (function() { 'use strict'; // Function to decode base64 string function decodeBase64(encodedString) { return atob(encodedString); } // Function to check if a string is a URL function isURL(string) { try { new URL(string); return true; } catch (_) { return false; } } // Select all elements var codeElements = document.querySelectorAll('code'); // Loop through each element codeElements.forEach(function(codeElement) { // Get the content of the element var encodedString = codeElement.textContent.trim(); // Decode the base64-encoded string var decodedString = decodeBase64(encodedString); // If the decoded string is a URL, create a clickable link if (isURL(decodedString)) { var link = document.createElement('a'); link.href = decodedString; link.textContent = decodedString; link.target = '_blank'; // Open link in a new tab codeElement.textContent = ''; // Clear the content of element codeElement.appendChild(link); // Append the link to the element } else { // Replace the content of the element with the decoded string codeElement.textContent = decodedString; } }); })();