From 116cf286559031ffeae05dfec9a667f3391355d0 Mon Sep 17 00:00:00 2001 From: PJ568 Date: Sun, 20 Aug 2023 13:57:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=99=BE=E5=BA=A6=E6=8E=A8?= =?UTF-8?q?=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/http_push.js | 1 + js/https_push.js | 1 + js/push_to_baidu.js | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 js/http_push.js create mode 100644 js/https_push.js diff --git a/js/http_push.js b/js/http_push.js new file mode 100644 index 00000000..4e36cf87 --- /dev/null +++ b/js/http_push.js @@ -0,0 +1 @@ +!function(){var e=/([http|https]:\/\/[a-zA-Z0-9\_\.]+\.baidu\.com)/gi,r=window.location.href,o=document.referrer;if(!e.test(r)){var n="//api.share.baidu.com/s.gif";o?(n+="?r="+encodeURIComponent(document.referrer),r&&(n+="&l="+r)):r&&(n+="?l="+r);var t=new Image;t.src=n}}(window); \ No newline at end of file diff --git a/js/https_push.js b/js/https_push.js new file mode 100644 index 00000000..2248c413 --- /dev/null +++ b/js/https_push.js @@ -0,0 +1 @@ +!function(){var e=/([http|https]:\/\/[a-zA-Z0-9\_\.]+\.baidu\.com)/gi,r=window.location.href,t=document.referrer;if(!e.test(r)){var o="https://sp0.baidu.com/9_Q4simg2RQJ8t7jm9iCKT-xh_/s.gif";t?(o+="?r="+encodeURIComponent(document.referrer),r&&(o+="&l="+r)):r&&(o+="?l="+r);var i=new Image;i.src=o}}(window); \ No newline at end of file diff --git a/js/push_to_baidu.js b/js/push_to_baidu.js index 092a6375..83513609 100644 --- a/js/push_to_baidu.js +++ b/js/push_to_baidu.js @@ -2,10 +2,10 @@ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { - bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; + bp.src = '/js/https_push.js'; } else { - bp.src = 'http://push.zhanzhang.baidu.com/push.js'; + bp.src = '/js/http_push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s);