Fix WebConfig bootstrap for legacy Android Chrome
Physical LG Android 5.1.1 testing found Chrome 43 could decode gzip but failed on the bootstrap's arrow syntax. Use ES5 functions and Promises while preserving retries, version refresh, and optional abort handling. Keep Google Zopfli gzip compression at 1,000 iterations. Verified the flashed V4.3 through its WiFi link using the real Android browser: bootstrap and main page gzip responses completed, settings loaded at 910.525 MHz, and no JavaScript or transfer errors were reported. Add a loader syntax regression and document legacy browser support.
This commit is contained in:
1 parent
02b8935794
commit
0feffaa3ab
4 files changed
+52
-42
No files matched your search
@@ -52,6 +52,13 @@ class WebConfigGzipTest(unittest.TestCase):
|
||||
for page in (ROOT / "webui/pages").glob("*.html"):
|
||||
self.assertEqual(gzip.decompress(blobs["MESH_HTML_" + page.stem.upper()]), page.read_bytes())
|
||||
|
||||
def test_loader_matches_legacy_android_browser_syntax(self):
|
||||
blobs = arrays((ROOT / "src/helpers/esp32/WebConfigHtml.h").read_text())
|
||||
loader = gzip.decompress(blobs["WEBCONFIG_HTML_LOADER"]).decode()
|
||||
script = loader.split("<script>", 1)[1].split("</script>", 1)[0]
|
||||
self.assertNotIn("=>", script)
|
||||
self.assertNotRegex(script, r"\b(?:async|await|let|const)\b")
|
||||
|
||||
def test_gzip_binding_uses_1000_iterations_without_changing_raw_ota_default(self):
|
||||
with mock.patch.object(zopfli_compress._gzip, "compress",
|
||||
return_value=gzip.compress(b"page", mtime=0)) as compress:
|
||||
|
||||
Reference in new issue
Block a user