close baidu Pry

自动关闭百度隐私追踪

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==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();
     }
})();