您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Analyzes webpage inputs and downloads results as a .txt file
// ==UserScript== // @name Webpage Dara Analyzer w/ Download Button // @namespace http://tampermonkey.net/ // @version 1.3 // @license MIT // @author SijosxStudio // @url https://gf.qytechs.cn/en/users/1375139-sijosxstudio // @description Analyzes webpage inputs and downloads results as a .txt file // @match http*://*/*/*/* // @grant none // ==/UserScript== (function() { 'use strict'; // Helper function to check if text is JavaScript code function isJavaScriptCode(text) { const codeIndicators = ["function", "var", "let", "const", "=>", "return", "if", "else", "{", "}"]; return codeIndicators.some(indicator => text.includes(indicator)); } // Function to validate and fix simple JavaScript code function validateAndFixCode(code) { try { new Function(code); // Basic syntax check return code; } catch (e) { return "// Syntax Error Fixed: " + e.message + "\n" + code.replace(/;(?=\s*;)/g, ""); // Removes duplicate semicolons } } // Function to summarize text while keeping key details function summarizeText(text) { return text.length > 100 ? text.slice(0, 97) + "..." : text; } // Function to crawl the page and analyze inputs function analyzePage() { let output = ""; const inputs = document.querySelectorAll("input, textarea"); inputs.forEach(input => { let value = input.value.trim(); if (!value) return; if (isJavaScriptCode(value)) { value = validateAndFixCode(value); output += `\n\nCode:\n${value}`; } else { const summary = summarizeText(value); output += `\n\nText Summary:\n${summary}`; } }); return output; } // Function to download analyzed content as a .txt file function downloadAsTextFile(content, filename = "webpage_analysis.txt") { const link = document.createElement("a"); link.href = "data:text/plain;charset=utf-8," + encodeURIComponent(content); link.download = filename; link.style.display = "none"; document.body.appendChild(link); link.click(); document.body.removeChild(link); } // Function to handle the analysis and download process function startAnalysis() { const analyzedContent = analyzePage(); downloadAsTextFile(analyzedContent || "No inputs to analyze."); } // Create the analysis button const analyzeButton = document.createElement("button"); analyzeButton.innerText = "Download Analysis"; analyzeButton.style.position = "fixed"; analyzeButton.style.bottom = "20px"; analyzeButton.style.right = "20px"; analyzeButton.style.padding = "10px 15px"; analyzeButton.style.backgroundColor = "#007AFF"; analyzeButton.style.color = "#fff"; analyzeButton.style.border = "none"; analyzeButton.style.borderRadius = "5px"; analyzeButton.style.cursor = "pointer"; analyzeButton.style.zIndex = "1000"; analyzeButton.onclick = startAnalysis; // Add button to the page document.body.appendChild(analyzeButton); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址