Skip to content

Should some files provide an alt? #215

@cookiecrook

Description

@cookiecrook

Web Share API images have optional title, but seem to be missing alt.

shareButton.addEventListener("click", async () => {
  const file = new File(data, "some.png", { type: "image/png" });
  try {
    await navigator.share({
      title: "Example File",
      files: [file],
      alt: "Marcos??? 🧐"  // accessible text alternative for the image, equivalent to HTML alt attr
    });
  } catch (err) {
    console.error("Share failed:", err.message);
  }
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    TPAC2025Topics for discussion at TPAC 2025

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions