MCPcopy Create free account
hub / github.com/ampproject/amphtml / getContextState

Function getContextState

3p/frame-metadata.js:106–128  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

104 * @return {!ContextStateDef}
105 */
106export function getContextState() {
107 const rawContext = allMetadata()['attributes']['_context'];
108
109 return {
110 ampcontextFilepath: rawContext['ampcontextFilepath'],
111 ampcontextVersion: rawContext['ampcontextVersion'],
112 canary: rawContext['canary'],
113 canonicalUrl: rawContext['canonicalUrl'],
114 clientId: rawContext['clientId'],
115 container: rawContext['container'],
116 domFingerprint: rawContext['domFingerprint'],
117 hidden: rawContext['hidden'],
118 initialIntersection: rawContext['initialIntersection'],
119 initialLayoutRect: rawContext['initialLayoutRect'],
120 mode: rawContext['mode'],
121 pageViewId: rawContext['pageViewId'],
122 referrer: rawContext['referrer'],
123 sentinel: rawContext['sentinel'],
124 sourceUrl: rawContext['sourceUrl'],
125 startTime: rawContext['startTime'],
126 tagName: rawContext['tagName'],
127 };
128}
129
130/**
131 * @return {string}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected