[codex] Optimize SEO performance and security hardening#193
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Deploying markdown-viewer with
|
| Latest commit: |
fd3b18d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://044efe81.markdown-viewer.pages.dev |
| Branch Preview URL: | https://codex-seo-performance-securi.markdown-viewer.pages.dev |
Deploying markdownviewer with
|
| Latest commit: |
fd3b18d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://dec3449c.markdownviewer.pages.dev |
| Branch Preview URL: | https://codex-seo-performance-securi.markdownviewer.pages.dev |
Owner
Author
Update: Inline LaTeX duplicate render fixAdded a follow-up fix for the initial paste lifecycle bug reported with: ## 1. Basic Arithmetic & Algebra
Inline: The quadratic formula is $x = \dfrac{-b \pm \sqrt{b^2 - 4ac}}{2a}$ and it has two roots.Root CauseThe preview math pipeline could re-process already-rendered MathJax output during the initial paste path. This happened because broad preview-root MathJax targets were reused during forced/no-op post-processing, and MathJax startup/loading was not centralized enough to avoid overlapping lifecycle work. Fix
Verification
|
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.
PR Title
[Phase 1 | Phase 2 | Phase 3]: Improve SEO metadata, load path, CSP hardening, and MathJax lifecycle cleanup
Investigation Summary
onloadhandler blocked strong CSP adoption.<script type="text/markdown">.bootstrap.bundleandscript.jswere not deferred.id,scope, and categories.Changes Made
Phase 1: SEO Optimization
max-image-preview:large,application-name,theme-color,og:site_name, JSON-LDsoftwareVersion, and a 5-itemfeatureList.id,scope, and categories.Verification: Static comparison: JSON-LD feature count
0 -> 5; manifest identity/scope/categories absent -> present.Phase 2: Website Performance
onload, replacing it with a normal stylesheet link so CSP can block inline script execution.<script type="text/markdown">to hidden<textarea>.Verification: Static comparison: deferred scripts
6 -> 8, inlineonloadhandlers1 -> 0, text-markdown script tags1 -> 0; local post-change app-ready sample averaged1082 msacross 5 reloads.Phase 3: Memory Management & Security
typesetClear, and removed the redundant AMS loader request.Verification: Fresh browser interaction inserted math Markdown, rendered
2MathJax containers, preview state stayedready, and fresh warning/error logs were empty.Verification Results
6 -> 8, inline handler count1 -> 0.index.html,manifest.json,script.js.Additional checks:
node --check script.jsnode --check preview-worker.jsmanifest.jsonparsed successfullyhttp://127.0.0.1:8080Conclusion
The app already had good sanitizer/SRI/caching foundations, but improvements were necessary. This PR adds measurable SEO/security/performance hardening while keeping the changes targeted and reversible.