Greasy Fork

Greasy Fork is available in English.

组卷网 打印

本插件用于方便地下载组卷网的试卷,仅作实验用途。

当前为 2024-11-09 提交的版本,查看 最新版本

// ==UserScript==
// @name         组卷网 打印
// @namespace    http://tampermonkey.net/
// @version      2024-11-09
// @description  本插件用于方便地下载组卷网的试卷,仅作实验用途。
// @author       fyc09
// @license      MIT
// @match        https://zujuan.xkw.com/usertk/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const elem = document.createElement("div");
    document.querySelector(".tools").appendChild(elem);
    elem.style = `
        display: block;
        height: 2.25rem;
        margin: 0 .9375rem;
        font-size: .875rem;
        box-sizing: border-box;
        padding: 0 .9375rem;
        line-height: 2.25rem;
        border-radius: .1875rem;
        position: relative;
        background: var(--primary-bg-color1);
        color: var(--font-color5);
    `;
    elem.className = "btn-box";
    elem.innerHTML = "(插件)下载";
    elem.onclick = () => {
        document.querySelectorAll(".header, .bread-nav, .other-info, .fiexd-nav, .footer, .clearfix").forEach(e => e.remove())
        document.querySelector(".exam-cnt").style.width = "100%";
        document.querySelector(".quesdiv").style.width = "0rem 1.25rem 0rem 1.625rem";
        document.documentElement.style.setProperty('--font-family1', '"Times New Roman", SimHei');
        document.documentElement.style.setProperty('--font-family2', '"Times New Roman", SimSun');
        document.documentElement.style.setProperty('--primary-color1', 'none');
        window.print();
    };
    console.log("插件已启动, elem");
})();

console.log("插件已启动, elem");