Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 6 additions & 1 deletion AddonScript.js
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
console.log("AddonScript.js has loaded.");
/*
DO NOT MODIFY THIS FILE,
IT IS KEPT HERE FOR BACKWARD COMPATIBILITY ONLY
*/

console.warn("Please update XMOJ-Script!");
11 changes: 11 additions & 0 deletions Update.json
Original file line number Diff line number Diff line change
Expand Up @@ -2729,6 +2729,17 @@
}
],
"Notes": "No release notes were provided for this release."
},
"1.3.2": {
"UpdateDate": 1739187728351,
"Prerelease": true,
"UpdateContents": [
{
"PR": 778,
"Description": "Change how we load addonscript (transition from GitHub pages to Cloudflare KV) + Fix *that* console error"
}
],
"Notes": "No release notes were provided for this release."
}
}
}
22 changes: 9 additions & 13 deletions XMOJ.user.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name XMOJ
// @version 1.3.1
// @version 1.3.2
// @description XMOJ增强脚本
// @author @XMOJ-Script-dev, @langningchen and the community
// @namespace https://github/langningchen
Expand Down Expand Up @@ -465,10 +465,7 @@ let RequestAPI = (Action, Data, CallBack) => {
try {
CallBack(JSON.parse(Response.responseText));
} catch (Error) {
console.log(Response.responseText);
CallBack({
"Success": false, "Message": "JSON解析错误:" + Error, "Data": null
});
console.error(Response.responseText);
}
}
});
Expand Down Expand Up @@ -1153,14 +1150,13 @@ async function main() {
new bootstrap.Modal(document.getElementById("UpdateModal")).show();
}
});
fetch(ServerURL + "/AddonScript.js", {cache: "no-cache"})
.then((Response) => {
return Response.text();
})
.then((Response) => {
eval(Response);
});

RequestAPI("GetAddOnScript", {}, (Response) => {
if (Response.Success) {
eval(Response.Data["Script"]);
} else {
console.warn("Fetch AddOnScript failed: " + Response.Message);
}
});
let ToastContainer = document.createElement("div");
ToastContainer.classList.add("toast-container", "position-fixed", "bottom-0", "end-0", "p-3");
document.body.appendChild(ToastContainer);
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": "1.3.1",
"version": "1.3.2",
"description": "an improvement script for xmoj.tech",
"main": "AddonScript.js",
"scripts": {
Expand Down