Commit 40d3cade by luoqi

Merge Baidu analytics origin fix into test

parents 7e2ec766 db03f5cd
Pipeline #3794 failed in 0 seconds
...@@ -24,7 +24,8 @@ export function BaiduAnalytics() { ...@@ -24,7 +24,8 @@ export function BaiduAnalytics() {
script.id = 'baidu-analytics'; script.id = 'baidu-analytics';
script.async = true; script.async = true;
script.src = `https://hm.baidu.com/hm.js?${SITE_ID}`; script.src = `https://hm.baidu.com/hm.js?${SITE_ID}`;
script.referrerPolicy = 'no-referrer'; // 百度按来源域名返回站点脚本,只发送 origin,避免暴露路径和参数。
script.referrerPolicy = 'origin';
document.head.appendChild(script); document.head.appendChild(script);
} }
const page = pathname const page = pathname
......
...@@ -24,7 +24,8 @@ export function BaiduAnalytics() { ...@@ -24,7 +24,8 @@ export function BaiduAnalytics() {
script.id = 'baidu-analytics'; script.id = 'baidu-analytics';
script.async = true; script.async = true;
script.src = `https://hm.baidu.com/hm.js?${SITE_ID}`; script.src = `https://hm.baidu.com/hm.js?${SITE_ID}`;
script.referrerPolicy = 'no-referrer'; // 百度按来源域名返回站点脚本,只发送 origin,避免暴露路径和参数。
script.referrerPolicy = 'origin';
document.head.appendChild(script); document.head.appendChild(script);
} }
const page = pathname const page = pathname
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment