您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Decode base64-encoded the FMHY Rentry page and make URLs clickable
当前为
- // ==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*
- // @match https://rentry.org/fmhybase64*
- // @match https://rentry.org/FMHYBase64*
- // @grant none
- // @namespace https://greasyfork.org/users/980489
- // ==/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 <code> elements
- var codeElements = document.querySelectorAll('code');
- // Loop through each <code> element
- codeElements.forEach(function(codeElement) {
- // Get the content of the <code> 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 <code> element
- codeElement.appendChild(link); // Append the link to the <code> element
- } else {
- // Replace the content of the <code> element with the decoded string
- codeElement.textContent = decodedString;
- }
- });
- })();