2017-07-11 49 views
0

時,$ {documentReferrer}爲空。通過AMP文檔(https://github.com/ampproject/amphtml/blob/master/spec/amp-var-substitutions.md#document-referrer)查看documentReferrer變量應該反映JS document.referrer當document.referrer爲「https://www.google.com/」

雖然documentReferrer似乎彙報其他域的正確值(如:www.twitter.com,t.co,linkedin.com等)時,頁面的document.referrer值是「https://www.google.com/documentReferrer是空的。我找不到任何文件表明www.google.com域名有任何額外的警告。

+0

什麼是你期望的結果? – noogui

+0

基於文檔,我期望AMP文章的'documentReferrer'在引用URL時是''https://www.google.com/「'。 –

回答

0

AMP文檔是準確的。 「https://www.google.com/」沒有例外。

值得一提的是,某些AMP標籤(如<analytics-tag>)允許您在標籤內部定義自定義變量供內部使用。這些變量可以優先於標籤範圍內的全局變量(如documentReferrer)。

有關一個非常特殊的情況下更多的細節,其中可能出現的看到:https://github.com/ampproject/amphtml/issues/10374