Explorar o código

Actually support the manifest property

Paulus Schoutsen %!s(int64=4) %!d(string=hai) anos
pai
achega
ba15c4360a
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      src/install-button.ts

+ 3 - 1
src/install-button.ts

@@ -1,6 +1,8 @@
 class InstallButton extends HTMLElement {
   public static isSupported = "serial" in navigator;
 
+  public manifest?: string;
+
   public eraseFirst?: boolean;
 
   private renderRoot?: ShadowRoot;
@@ -26,7 +28,7 @@ class InstallButton extends HTMLElement {
     });
     this.addEventListener("click", async (ev) => {
       ev.preventDefault();
-      const manifest = this.getAttribute("manifest");
+      const manifest = this.manifest || this.getAttribute("manifest");
       if (!manifest) {
         alert("No manifest defined!");
         return;