当 document.referrer 为 "https://www.google.com/" 时,${document Referrer} 为空

${documentReferrer} is empty when document.referrer is "https://www.google.com/"

查看 AMP 文档 (https://github.com/ampproject/amphtml/blob/master/spec/amp-var-substitutions.md#document-referrer) 似乎 documentReferrer 变量应该反映 JS document.referrer.

虽然 documentReferrer 似乎报告了其他域的正确值(例如:www.twitter.com、t.co、linkedin.com 等)当页面的 document.referrer 值为“https://www.google.com/documentReferrer 为空。我找不到任何文件表明 www.google.com 域带有任何额外的警告。

AMP 文档是准确的。 “https://www.google.com/”也不例外。

值得一提的是,某些 AMP 标签(如 <analytics-tag>)允许您定义自定义变量以供标签内的内部使用。在该标记的范围内,这些变量可以优先于全局变量(如 documentReferrer)。

有关可能发生这种情况的一种非常具体的情况的更多详细信息,请参阅:https://github.com/ampproject/amphtml/issues/10374