curProtocol = window.location.protocol.split(':')[0];# W' X" N! G: g
} % E0 h; Z% ` p/ q& W7 _5 j
else{ # u6 ?7 \: p9 t* S% J
curProtocol = canonicalURL.split(':')[0]; % t- \! D! R7 z4 F
} % `+ Q8 L% Z* i; W5 {$ l
//Get current URL if the canonical URL does not exist$ {7 x8 X- w1 w
if (!canonicalURL) canonicalURL = window.location.href; 0 q& O% v0 j- B9 x( Y) G i+ B
//Assign script content. Replace current URL with the canonical URL ) I( p! F. X* U7 s! f. Y
!function(){var e=/([http|https]:\/\/[a-zA-Z0-9\_\.]+\.baidu\.com)/gi,r=canonicalURL,t=document.referrer;if(!e.test(r)){var n=(String(curProtocol).toLowerCase() === 'https')?"https://sp0.baidu.com/9_Q4simg2RQJ8t7jm9iCKT-xh_/s.gif":"//api.share.baidu.com/s.gif";t?(n+="?r="+encodeURIComponent(document.referrer),r&&(n+="&l="+r)):r&&(n+="?l="+r);var i=new Image;i.src=n}}(window);})();9 y, Y, A' z; m
</script> . k n, Q0 i( c+ e
复制代码
1 ^( k9 o! R( E2 Z/ F' i
8 A: X y/ L) @! N8 X% @1 E
; a8 |1 e2 @0 y9 v7 ]& |