diff --git a/index.html b/index.html index 445306e..ebb931a 100644 --- a/index.html +++ b/index.html @@ -552,6 +552,35 @@ button.overrides = { }; +

Generating a manifest dynamically & version management

+

+ Alternatively to a static manifest JSON file, you can generate a Blob URL of a JSON object using URL.createObjectURL to use as the manifest url. This can be useful in situations where you have many firmware bin files, e.g. previous software versions, where you don't want to have a different static manifest json file for each bin. If you are hosting on github.io, this can be paired nicely with github's REST API to view all the bin files inside a folder. +

+
+const manifest = {
+    "name": name,
+    "version": version,
+    "funding_url": funding_url,
+    "new_install_prompt_erase": true,
+    "builds": [
+        {
+            "chipFamily": "ESP32",
+            "improv": false,
+            "parts": [
+                { "path": dependenciesDir+"bootloader.bin", "offset": 4096 },
+                { "path": dependenciesDir+"partitions.bin", "offset": 32768 },
+                { "path": dependenciesDir+"boot_app0.bin", "offset": 57344 },
+                { "path": firmwareFile, "offset": 65536 }
+            ]
+        }
+    ]
+}
+
+const json = JSON.stringify(manifest);
+const blob = new Blob([json], {type: "application/json"});
+document.querySelector("esp-web-install-button").manifest = URL.createObjectURL(blob);
+      
+

Customizing the look and feel

You can change the colors of the default UI elements with CSS custom