Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
2db8ece
refactor: migrate backend calls to /v1 routes
Copilot Apr 11, 2026
bf67523
3.4.3
github-actions[bot] Apr 11, 2026
cb3db4a
Update version info to 3.4.3
github-actions[bot] Apr 11, 2026
9afb3df
Update endpoint description in Update.json
def-WA2025 Apr 12, 2026
5c6e3c5
Update time and description of 3.4.3
github-actions[bot] Apr 12, 2026
bf3182f
Merge pull request #969 from XMOJ-Script-dev/copilot/change-apis-to-v…
def-WA2025 Apr 12, 2026
c24d3fc
Fix loginpage.php Loop
def-WA2025 Apr 12, 2026
02881c8
3.4.4
github-actions[bot] Apr 12, 2026
d825aee
Update version info to 3.4.4
github-actions[bot] Apr 12, 2026
95bdcd7
Refactor login check for clarity and efficiency
def-WA2025 Apr 12, 2026
20abaf0
Update time and description of 3.4.4
github-actions[bot] Apr 12, 2026
1fdc33c
Revert /v1 endpoint migration while keeping version metadata
boomzero Apr 12, 2026
11180a8
3.4.4
github-actions[bot] Apr 12, 2026
57467ea
Update version info to 3.4.4
github-actions[bot] Apr 12, 2026
4caf55d
Merge pull request #975 from XMOJ-Script-dev/revert/v1-endpoint-migra…
boomzero Apr 12, 2026
522d37f
Fix loginpage.php Loop
def-WA2025 Apr 12, 2026
2415c7f
Bump version from 3.4.4 to 3.4.5
def-WA2025 Apr 12, 2026
9b62fba
Merge branch 'dev' into fix/loginpage-loop
def-WA2025 Apr 12, 2026
b5397c6
Update time and description of 3.4.5
github-actions[bot] Apr 12, 2026
e23fdd6
Update time and description of 3.4.5
github-actions[bot] Apr 12, 2026
45c56a2
Merge pull request #973 from XMOJ-Script-dev/fix/loginpage-loop
def-WA2025 Apr 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions Update.json
Original file line number Diff line number Diff line change
Expand Up @@ -3541,6 +3541,39 @@
}
],
"Notes": "Add hourly automatic cloud settings sync. Every hour, if CloudSync is enabled, settings are downloaded from the cloud and applied locally, then local settings are uploaded to the cloud. This keeps settings in sync across devices without requiring a visit to the settings page."
},
"3.4.3": {
"UpdateDate": 1775972372292,
"Prerelease": true,
"UpdateContents": [
{
"PR": 969,
"Description": "Migrate XMOJ-BBS client endpoints to /v1 routes"
}
],
"Notes": "No release notes were provided for this release."
},
"3.4.4": {
"UpdateDate": 1775993504358,
"Prerelease": true,
"UpdateContents": [
{
"PR": 975,
"Description": "Revert /v1 endpoint migration"
}
],
"Notes": "Revert the `/v1` endpoint migration from #969 to restore original API routes."
},
"3.4.5": {
"UpdateDate": 1776009434318,
"Prerelease": true,
"UpdateContents": [
{
"PR": 973,
"Description": "Fix loginpage.php Loop"
}
],
"Notes": "Fix loginpage.php loop."
}
}
}
11 changes: 8 additions & 3 deletions XMOJ.user.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name XMOJ
// @version 3.4.2
// @version 3.4.5
// @description XMOJ增强脚本
// @author @XMOJ-Script-dev, @langningchen and the community
// @namespace https://github/langningchen
Expand Down Expand Up @@ -911,14 +911,19 @@ GM_registerMenuCommand("重置数据", () => {
});

//otherwise CurrentUsername might be undefined
let loginStatus;
await fetch("https://www.xmoj.tech/loginpage.php")
.then((response) => response.text())
.then((data) => (loginStatus = data));
const logined = loginStatus == "<a href=logout.php>Please logout First!</a>";
if (UtilityEnabled("AutoLogin") && document.querySelector("body > a:nth-child(1)") != null && document.querySelector("body > a:nth-child(1)").innerText == "请登录后继续操作") {
localStorage.setItem("UserScript-LastPage", location.pathname + location.search);
location.href = "https://www.xmoj.tech/loginpage.php";
}

let SearchParams = new URLSearchParams(location.search);
let ServerURL = (UtilityEnabled("DebugMode") ? "https://ghpages.xmoj-bbs.me/" : "https://www.xmoj-bbs.me")
if (document.querySelector("#profile") === null) {
if (document.querySelector("#profile") === null && !logined) {
location.href = "https://www.xmoj.tech/loginpage.php";
}
let CurrentUsername = document.querySelector("#profile").innerText;
Expand Down Expand Up @@ -1183,7 +1188,7 @@ async function main() {
document.querySelector("body > div > div.jumbotron").className = "mt-3";
}

if (UtilityEnabled("AutoLogin") && document.querySelector("#profile") != null && document.querySelector("#profile").innerHTML == "登录" && location.pathname != "/login.php" && location.pathname != "/loginpage.php" && location.pathname != "/lostpassword.php") {
if (UtilityEnabled("AutoLogin") && document.querySelector("#profile") != null && document.querySelector("#profile").innerHTML == "登录" && location.pathname != "/login.php" && location.pathname != "/loginpage.php" && location.pathname != "/lostpassword.php" && !logined) {
localStorage.setItem("UserScript-LastPage", location.pathname + location.search);
location.href = "https://www.xmoj.tech/loginpage.php";
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xmoj-script",
"version": "3.4.2",
"version": "3.4.5",
"description": "an improvement script for xmoj.tech",
"main": "AddonScript.js",
"scripts": {
Expand Down
Loading