close baidu Pry

自动关闭百度隐私追踪

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         close baidu Pry
// @version      0.6
// @description  自动关闭百度隐私追踪
// @author       gafx
// @match        *://*.baidu.com/*
// @require        http://cdn.bootcss.com/jquery/1.12.4/jquery.min.js
// @require        http://cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.min.js
// @namespace http://tampermonkey.net/
// ==/UserScript==

function show_msg(){
    var msg_box = document.createElement('div');
    msg_box.style.position='absolute';
    msg_box.style.top=0;
    msg_box.style.right=0;
    msg_box.style.zIndex=99999;
    msg_box.style.width='100%';
    msg_box.style.fontSize='1.2rem';
    msg_box.style.textAlign='center';
    msg_box.style.display='none';
    msg_box.style.background='#00b643';
    msg_box.style.color='white';
    msg_box.innerText='已关闭百度隐私追踪!';
    msg_box.id='f_bd_lalala';
   
    document.body.appendChild(msg_box);
    $("#f_bd_lalala").fadeIn(2000);
    $("#f_bd_lalala").fadeOut(2000);
    
}

(function() {
    expires_time= new Date(Date.now()+356*100*24*60*60*1000);
    if(document.cookie.match(/PRY=(\d)/)){
        pry_value = document.cookie.match(/PRY=(\d)/)[1];
        if (pry_value == '0'){
            $.cookie('PRY',1,{expires:expires_time,domain:'.baidu.com'});
            show_msg();
        }
     }else{
         $.cookie('PRY',1,{expires:expires_time,domain:'.baidu.com'});
         show_msg();
     }
})();