feat: WebUI for XMOJ short messages (messages.html) + CORS proxy + userscript integration#941
Closed
feat: WebUI for XMOJ short messages (messages.html) + CORS proxy + userscript integration#941
Conversation
…uto-fill Co-authored-by: PythonSmall-Q <106425289+PythonSmall-Q@users.noreply.github.com>
Deploying xmoj-script-dev-channel with
|
| Latest commit: |
f9a8762
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://4c8622ae.xmoj-script-dev-channel.pages.dev |
| Branch Preview URL: | https://copilot-feature-webui-short.xmoj-script-dev-channel.pages.dev |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| <title>XMOJ 短消息</title> | ||
| <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.2.3/css/bootstrap.min.css" rel="stylesheet"> | ||
| <script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.2.3/js/bootstrap.bundle.min.js"></script> |
Check failure
Code scanning / CodeQL
Untrusted domain used in script or other content High
| <title>XMOJ 短消息</title> | ||
| <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.2.3/css/bootstrap.min.css" rel="stylesheet"> | ||
| <script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.2.3/js/bootstrap.bundle.min.js"></script> | ||
| <script src="https://cdn.bootcdn.net/ajax/libs/marked/9.1.6/marked.min.js"></script> |
Check failure
Code scanning / CodeQL
Untrusted domain used in script or other content High
| <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.2.3/css/bootstrap.min.css" rel="stylesheet"> | ||
| <script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.2.3/js/bootstrap.bundle.min.js"></script> | ||
| <script src="https://cdn.bootcdn.net/ajax/libs/marked/9.1.6/marked.min.js"></script> | ||
| <script src="https://cdn.bootcdn.net/ajax/libs/dompurify/3.0.6/purify.min.js"></script> |
Check failure
Code scanning / CodeQL
Untrusted domain used in script or other content High
Co-authored-by: PythonSmall-Q <106425289+PythonSmall-Q@users.noreply.github.com>
7 tasks
…stile, fix IP cookie check Co-authored-by: PythonSmall-Q <106425289+PythonSmall-Q@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [Feature Request] Add WebUI for viewing short messages
feat: WebUI for XMOJ short messages (iOS/iPadOS support)
Mar 15, 2026
…nabled recursion, semicolon Co-authored-by: PythonSmall-Q <106425289+PythonSmall-Q@users.noreply.github.com>
Copilot
AI
changed the title
feat: WebUI for XMOJ short messages (iOS/iPadOS support)
feat: WebUI for XMOJ short messages (messages.html) + CORS proxy + userscript integration
Mar 15, 2026
Copilot stopped work on behalf of
PythonSmall-Q due to an error
March 15, 2026 08:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
iOS/iPadOS users cannot install userscripts, making XMOJ short messages inaccessible. This adds a standalone
messages.htmlweb page with full send/receive/image support, wired into the existing userscript for seamless session hand-off.New:
messages.htmlapi.xmoj-bbs.meindex.htmlnavbar and feature listNew:
functions/api-proxy/[[path]].jsCloudflare Pages Function that proxies all API POST requests server-side to
api.xmoj-bbs.me, bypassing browser CORS restrictions. SSRF-guarded to only forward to the allow-listed upstream.API_BASEinmessages.htmlis a relative/api-proxy/path, so it works on any deployment domain without configuration.XMOJ.user.jschanges@matchforxmoj-bbs.me/messages.html; on that domain the script exits after injecting the auto-fill only (no other features run)PHPSESSIDviaGM.cookie.list()(handles HttpOnly cookies) and firesxmoj-autofill-sessionon the page; toasts the user to log in if no session is found#profile === null → loginpage.phpredirect behind a hostname check so xmoj-bbs.me is never redirectedUtilityEnabledcatch block infinite recursion (was calling itself; now returnsfalse)assets.xmoj-bbs.meimage URLs withapi.xmoj-bbs.meServerURLdeclarationBug fixes
参数DebugMode未找到backend errorDebugMode: falseto everymessages.htmlAPI POST bodyUtilityEnabledstack overflow whenlocalStorageunavailablefalseinstead of recursingloginpage.phpon xmoj-bbs.melocation.replacenow gated onhostnamecheckassets.xmoj-bbs.me→api.xmoj-bbs.methroughoutOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Summary by cubic
Add a web UI to read and send XMOJ short messages without the userscript, with bookmarklet/manual
PHPSESSIDlogin, image uploads, and a split‑pane chat interface; works on iOS/iPadOS. Linked fromindex.htmlwith an Alpha badge and integrates with the userscript for auto-login.New Features
PHPSESSID; no password storage. All API calls go through a same‑origin Cloudflare Pages CORS proxy (/api-proxy/) with SSRF guard and allow‑listed headers.xmoj-autofill-session/xmoj-show-toast; userscript only scopesmessages.html.Bug Fixes
DebugMode: falsein POST (fixes “参数DebugMode未找到”); image URLs now usehttps://api.xmoj-bbs.me.xmoj-bbs.me/messages.html; readPHPSESSIDfrom bothwww.xmoj.techand116.62.212.172; fixUtilityEnabledrecursion; add missing semicolon.Written for commit f9a8762. Summary will update on new commits.