您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Print function for ExamTopics
当前为
// ==UserScript== // @name ExamTopic Print // @namespace http://tampermonkey.net/ // @version 2024-09-19 // @description Print function for ExamTopics // @author You // @icon https://cdn-icons-png.flaticon.com/512/839/839184.png // @match https://www.examtopics.com/* // @grant none // ==/UserScript== (function() { 'use strict'; window.addEventListener('load', function() { var printButton = document.createElement("button"); printButton.innerHTML = "Print"; printButton.style.marginLeft = "10px"; printButton.onclick = printFunction; var correctAnswerBox = document.querySelector(".correct-answer-box br"); correctAnswerBox.parentNode.insertBefore(printButton, correctAnswerBox); function printFunction() { var selectedElement = document.querySelectorAll(".col-12")[1]; var clonedElement = selectedElement.cloneNode(true); var listItemElements = clonedElement.querySelectorAll("li"); listItemElements.forEach(function (listItem) { listItem.className = "multi-choice-item"; }); var garbege = [ '.all-questions-link', '.correct-answer-box', '.disclaimer-box', 'span.badge.badge-success.most-voted-answer-badge', ]; garbege.forEach(function(selector) { var elements = clonedElement.querySelectorAll(selector); elements.forEach(function(element) { element.parentNode.removeChild(element); }); }); var mywindow = window.open("", "PRINT", "height=1754,width=1240"); mywindow.document.write(` <html> <head> <title>${document.title}</title> `); Array.prototype.forEach.call(document.styleSheets, function (sheet) { mywindow.document.write( `<style type="text/css"> body { font-family: Arial !important; } @page { margin-left: 1.3in; margin-right: 1.3in; } </style> <link rel="stylesheet" href="${sheet.href}" type="text/css" />` ); }); mywindow.document.write(` </head> <body> ${clonedElement.innerHTML} </body> </html> `); setTimeout(function() { mywindow.print(); }, 200); return true; } }, false); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址