fix(modes): deep-linked mode scripts fail when body not yet parsed

ensureModeScript() used document.body.appendChild() to load lazy mode
scripts, but the preload for ?mode= query params runs in <head> before
<body> exists, causing all deep-linked modes to silently fail.

Also fix cross-mode handoffs (BT→BT Locate, WiFi→WiFi Locate,
Spy Stations→Waterfall) that assumed target module was already loaded.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Smittix
2026-03-12 20:49:08 +00:00
parent 7c425dbd99
commit ba631811a6
87 changed files with 9128 additions and 8368 deletions
+2 -2
View File
@@ -173,8 +173,8 @@ def test_capture_pmkid_path_traversal_prevention(client):
"""Ensure the status check rejects invalid paths."""
payload = {'file': '/etc/passwd'} # Malicious path
response = client.post('/wifi/pmkid/status', json=payload)
assert response.status_code == 200
assert response.status_code == 400
assert response.get_json()['status'] == 'error'
assert 'Invalid capture file path' in response.get_json()['message']