xmoj-script 1.7.2 → 1.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Update.json CHANGED
@@ -2873,6 +2873,17 @@
2873
2873
  }
2874
2874
  ],
2875
2875
  "Notes": "No release notes were provided for this release."
2876
+ },
2877
+ "1.7.3": {
2878
+ "UpdateDate": 1750594769202,
2879
+ "Prerelease": true,
2880
+ "UpdateContents": [
2881
+ {
2882
+ "PR": 811,
2883
+ "Description": "fix: Redirect to login page if profile element is missing"
2884
+ }
2885
+ ],
2886
+ "Notes": "No release notes were provided for this release."
2876
2887
  }
2877
2888
  }
2878
2889
  }
package/XMOJ.user.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // ==UserScript==
2
2
  // @name XMOJ
3
- // @version 1.7.2
3
+ // @version 1.7.3
4
4
  // @description XMOJ增强脚本
5
5
  // @author @XMOJ-Script-dev, @langningchen and the community
6
6
  // @namespace https://github/langningchen
@@ -559,6 +559,9 @@ window.addEventListener('DOMContentLoaded', async () => {
559
559
 
560
560
  let SearchParams = new URLSearchParams(location.search);
561
561
  let ServerURL = (UtilityEnabled("DebugMode") ? "https://ghpages.xmoj-bbs.me/" : "https://www.xmoj-bbs.me")
562
+ if (document.querySelector("#profile") === null) {
563
+ location.href = "https://www.xmoj.tech/loginpage.php";
564
+ }
562
565
  let CurrentUsername = document.querySelector("#profile").innerText;
563
566
  CurrentUsername = CurrentUsername.replaceAll(/[^a-zA-Z0-9]/g, "");
564
567
  let IsAdmin = AdminUserList.indexOf(CurrentUsername) !== -1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xmoj-script",
3
- "version": "1.7.2",
3
+ "version": "1.7.3",
4
4
  "description": "an improvement script for xmoj.tech",
5
5
  "main": "AddonScript.js",
6
6
  "scripts": {