CodeHS Cheat

Funny

目前為 2024-06-04 提交的版本,檢視 最新版本

// ==UserScript==
// @name         CodeHS Cheat
// @namespace    http://tampermonkey.net/
// @version      2024-05-29 v5 skibidi version
// @description  Funny
// @author       Anghel sefu la bani
// @match        https://codehs.com/student/*/assignment/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=codehs.com
// @grant    GM_setClipboard
// @license MIT
// ==/UserScript==
(function() {

    function cleanHTMLString(htmlString) {
    // Remove comments
    htmlString = htmlString.replace(/<!--[\s\S]*?-->/g, '');

    // Remove <noscript> tags and their content
    htmlString = htmlString.replace(/<noscript[\s\S]*?<\/noscript>/gi, '');

    // Remove <script> tags inside the <head> section
    htmlString = htmlString.replace(/(<head[\s\S]*?>[\s\S]*?)<script[\s\S]*?<\/script>/gi, (match, p1) => {
        // Remove <script> tags from the <head> section content
        return p1.replace(/<script[\s\S]*?<\/script>/gi, '');
    });

    // Clean comments inside <title> tags
    htmlString = htmlString.replace(/<title>([\s\S]*?)<\/title>/gi, (match, p1) => {
        // Remove comments from the title content
        const cleanedTitle = p1.replace(/<!--[\s\S]*?-->/g, '');
        return `<title>${cleanedTitle}</title>`;
    });

    return `<!DOCTYPE html>\n` + htmlString;
}
    'use strict';
    let htmlc;

    console.log("FUNNY SKIBIDI LOADED");

    const textField = document.querySelector('.ace_text');
    const ace_content = document.querySelector('.ace_content');
    const text_area = document.querySelector('.ace_text-input');
    const xbutton = document.querySelector('.start-ex-button');
    const iframe = document.querySelector('.sample-sols');

    window.addEventListener('load', function () {

        const secondHTML = iframe.contentDocument || iframe.contentWindow.document;

        console.log(secondHTML.children[0]);
        const HTMLCode = secondHTML.children[0].outerHTML;
        htmlc = cleanHTMLString(HTMLCode);
        console.log(htmlc);
        GM_setClipboard (htmlc);
        console.log("CODE COPIED");
        xbutton.click();
    })
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址