// ==UserScript== // @name 四川文理在线考试 // @namespace https://greasyfork.org/zh-CN/users/707063-genexy // @version 202112012338 // @description 四川文理学在线考试助手 // @author 流浪的蛊惑 // @match *://*.wdjycj.com/* // @require https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js // @grant none // @license MIT // @downloadURL none // ==/UserScript== function addXMLRequestCallback(callback){//监听请求 var oldSend, i; if( XMLHttpRequest.callbacks ) { XMLHttpRequest.callbacks.push( callback ); } else { XMLHttpRequest.callbacks = [callback]; oldSend = XMLHttpRequest.prototype.send; XMLHttpRequest.prototype.send = function(){//监听发送 for( i = 0; i < XMLHttpRequest.callbacks.length; i++ ) { XMLHttpRequest.callbacks[i]( this ); } oldSend.apply(this, arguments); } XMLHttpRequest.prototype.wrappedSetRequestHeader=XMLHttpRequest.prototype.setRequestHeader; XMLHttpRequest.prototype.setRequestHeader = function(header, value) {//监听自定义主机头 this.wrappedSetRequestHeader(header, value); if(!this.headers) { this.headers = {}; } if(!this.headers[header]) { this.headers[header] = []; } this.headers[header].push(value); } } } function testpaper(data){ let pdata=data.exam_data; let sd={ answer_data:[], answer_time:1800+parseInt(Math.random()*3600), host:"www.wdjycj.com", is_complete:1 }; sd.token=localStorage.getItem("userToken"); sd.paper_record_id=data.id; let da={}; for(let i=0;i