Fix app broken on Windows due to IE Compatibility Mode#211
Conversation
- Add IECompatibilityMiddleware to FastAPI server that adds
X-UA-Compatible: IE=edge header to all responses, preventing
Edge/IE from entering IE Compatibility Mode which caused:
* SCRIPT1028 (Swiper v11 modern JS syntax failure)
* HTML1416 (-- inside HTML comments)
* HTML1500 (self-closing non-void tag)
- Add <meta http-equiv="X-UA-Compatible" content="IE=edge" /> to
main.html as a belt-and-suspenders measure
- Fix -- inside HTML comments in control-panel.html and search-panel.html
(replace -- with : to avoid HTML1416 in SGML-strict parsers)
- Fix self-closing <animateTransform /> in spinner.html with explicit
closing tag to avoid HTML1500
- Add tests verifying X-UA-Compatible header on HTML and API responses
Agent-Logs-Url: https://github.com/lstein/PhotoMapAI/sessions/907b9c95-1c90-4b09-b532-a2f69f736312
Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
…ructions Agent-Logs-Url: https://github.com/lstein/PhotoMapAI/sessions/b377bd0b-af3a-43f2-a1a9-b9a2da8b8ec9 Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
|
@copilot On older edge browsers, the "Browser not Supported" message appears for about 5 seconds, and is then replaced by the nonfunctional screen reported in the original issue. With the newer edge, the application is working properly. |
…rite() Agent-Logs-Url: https://github.com/lstein/PhotoMapAI/sessions/80699240-b634-4385-8889-b3ba010143ec Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Fixed in c5b61c1. The root cause was that The fix replaces |
Fixes the app on Windows where legacy Microsoft Edge (EdgeHTML / Edge 44) fails to run the application due to incompatible JavaScript.
Changes Made
main.html(before any external scripts) that detects legacy EdgeHTML viawindow.StyleMediawith an optional-chaining syntax probe as fallback, then immediately callswindow.location.replace("/static/unsupported-browser.html")to navigate away before any ES2020 code loads. This avoids the race condition wheredocument.write()would be overwritten by the rest of the original page after ~5 seconds.static/unsupported-browser.html— a standalone styled page that tells the user they are on Microsoft Edge (Legacy), and provides step-by-step instructions to install the new Chromium-based Edge. Chrome and Firefox are also mentioned as alternatives.main.html.<path ... />to<path ...></path>inmetadata-drawer.htmlto resolveHTML1500errors.Testing
test_legacy_edge_detection_script_present— asserts the detection probe and redirect path are present in the served HTMLtest_unsupported_browser_page_served— asserts the static warning page is served and contains the upgrade link