Get desktop application:
View/edit binary Protocol Buffers messages
A Metadata is part of the transformers' response, and includes additional information either not present in or not easily accessible from the HTML. It should remain relatively small, as it undergoes a serialization/deserialization round-trip when the Go library is called from C.
Absolute URLs of resources that should be preloaded when the AMP is prefetched. In a signed exchange (SXG) context, these would be included as `Link: rel=preload` headers, as these are used by the browser during SXG prefetch: https://github.com/WICG/webpackage/blob/master/explainer.md#prefetching-stops-here
Recommended validity duration (`expires - date`), in seconds, of the SXG, based on the content being signed. In particular, JS is given a shorter lifetime to reduce risk of issues due to downgrades: https://wicg.github.io/webpackage/draft-yasskin-http-origin-signed-responses.html#seccons-downgrades.
Used in:
The URL of the resource to preload. Will be an absolute URL on the domain of the target AMP cache.
The `as` attribute of the preload, as specified in https://w3c.github.io/preload/#as-attribute and https://html.spec.whatwg.org/multipage/semantics.html#attr-link-as. The full list of potential values is specified in https://fetch.spec.whatwg.org/#concept-request-destination, though for the time being only "script", "style", and "image" are allowed.
The media attribute for image preload link. This attribute is useful only for image links. Deprecated, instead use the `attributes` field.
Optional remaining attributes. This does not include the `href` or `as` attributes.
If true, this is a modulepreload instead of a preload.
Used in:
A Request encapsulates input and contextual parameters for use by the transformers.
The AMP HTML document to transform.
The public URL of the document, i.e. the location that should appear in the browser URL bar.
The AMP runtime version.
The CSS contents to inline into the transformed HTML
Transformations are only run if the HTML tag contains the attribute specifying one of the provided formats. If allowed_formats is empty, then all non-experimental AMP formats are allowed.
If config == CUSTOM, this is the list of custom transformers to execute, in the order provided here. Otherwise, this is ignored.
The version of the transforms to perform (optional). If specified, it must be a supported version.
This should be kept in sync with HtmlFormat.Code in github.com/ampproject/amphtml/validator/validator.proto. Deprecated fields, do not reuse: reserved 5;
Used in:
Never used
Currently unused
Used in:
Execute the default list of transformers. For packager production environments, this should be the config used.
Execute none, and simply parse and re-emit. Some normalization will be performed regardless, including, but not limited to: - HTML normalization (e.g. closing all non-void tags). - removal of all comments - lowercase-ing of attribute keys - lexical sort of attribute keys - text is escaped WARNING. THIS IS FOR TESTING PURPOSES ONLY. Use of this setting in a packager production environment could produce invalid transformed AMP when ingested by AMP caches.
Execute the minimum needed for verification/validation. WARNING. FOR AMP CACHE USE ONLY. Use of this setting in a packager production environment could produce invalid transformed AMP when ingested by AMP caches.
Execute a custom set of transformers. WARNING. THIS IS FOR TESTING PURPOSES ONLY. Use of this setting in a packager production environment could produce invalid transformed AMP when ingested by AMP caches.
An inclusive range of version numbers.