Skip to content

Add API to retrieve document's computed manifest #1179

@dmurph

Description

@dmurph

Devs want to be able to fetch the document's current manifest state, and possible get other metadata, for production code & testing.

Some possible ideas:

let manifest;
try {
 manifest = await document.getManifest();
} catch (e) {
  // handle network error, parsing error, etc.
}
console.log(manifest.id);
// Is metadata needed?
let metadata = manifest.getMetadata();
// The manifest is always populated with defaults
console.log(metadata.isDefaultManifest);

or maybe

let data;
try {
  data = await document.getManifest();
} catch (e) {
   // handle network error, parsing error, etc.
}
let manifest = data.manifest;
console.log(manifest.id);
let metadata = data.metadata;
let isDefault = metadata.isDefault;

or maybe

let manifest;
try {
  manifest = await document.getManifest({excludeDefaultManifest: true});
} catch (e) {
     // handle network error, parsing error, etc.
}
if (manifest != null) {
  console.log(manifest.id);
}

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