From 4e83911c10aff9a615c57acb083e9e29577d4b78 Mon Sep 17 00:00:00 2001 From: zhouyiqing0304 <94766918+zhouyiqing0304@users.noreply.github.com> Date: Fri, 9 Aug 2024 15:29:19 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=BC=BA=E5=88=B6O2?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhouyiqing0304 <94766918+zhouyiqing0304@users.noreply.github.com> --- XMOJ.user.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index 0c93e8bd..258b77fb 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -2754,13 +2754,15 @@ async function main() { ErrorElement.style.display = "none"; document.querySelector("#Submit").disabled = true; document.querySelector("#Submit").value = "正在提交..."; + let o2Switch="&enable_O2=on"; + if(!document.querySelector("#enable_O2").checked)o2Switch=""; await fetch("https://www.xmoj.tech/submit.php", { "headers": { "content-type": "application/x-www-form-urlencoded" }, "referrer": location.href, "method": "POST", - "body": (SearchParams.get("id") != null ? "id=" + SearchParams.get("id") : "cid=" + SearchParams.get("cid") + "&pid=" + SearchParams.get("pid")) + "&language=1&" + "source=" + encodeURIComponent(CodeMirrorElement.getValue()) + "&" + "enable_O2=on" + "body": (SearchParams.get("id") != null ? "id=" + SearchParams.get("id") : "cid=" + SearchParams.get("cid") + "&pid=" + SearchParams.get("pid")) + "&language=1&" + "source=" + encodeURIComponent(CodeMirrorElement.getValue()) + o2Switch }).then(async (Response) => { if (Response.redirected) { location.href = Response.url; From 0b1406f6c1a8d76961a9aacde489f10d8a011dc2 Mon Sep 17 00:00:00 2001 From: zhouyiqing0304 <94766918+zhouyiqing0304@users.noreply.github.com> Date: Fri, 9 Aug 2024 15:59:33 +0800 Subject: [PATCH 2/2] Update XMOJ.user.js Signed-off-by: zhouyiqing0304 <94766918+zhouyiqing0304@users.noreply.github.com> --- XMOJ.user.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index 258b77fb..9d1e39a7 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -2803,13 +2803,15 @@ async function main() { ErrorMessage.style.color = "red"; ErrorMessage.innerText = "比赛已结束, 正在尝试像题目 " + rPID + " 提交"; console.log("比赛已结束, 正在尝试像题目 " + rPID + " 提交"); + let o2Switch="&enable_O2=on"; + if(!document.querySelector("#enable_O2").checked)o2Switch=""; await fetch("https://www.xmoj.tech/submit.php", { "headers": { "content-type": "application/x-www-form-urlencoded" }, "referrer": location.href, "method": "POST", - "body": "id=" + rPID + "&language=1&" + "source=" + encodeURIComponent(CodeMirrorElement.getValue()) + "&" + "enable_O2=on" + "body": "id=" + rPID + "&language=1&" + "source=" + encodeURIComponent(CodeMirrorElement.getValue()) + o2Switch }).then(async (Response) => { if (Response.redirected) { location.href = Response.url;