fuckjb51

filter something you don't like

Verze ze dne 29. 11. 2016. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         fuckjb51
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  filter something you don't like 
// @author       zhangolve contact   [email protected]
// @license      GPL version 2 or any later version; http://www.gnu.org/licenses/gpl-2.0.txt
// @match        https://www.baidu.com/*
// @grant             GM_setValue
// @grant             GM_getValue
//@grant              GM_deleteValue
// ==/UserScript==

(function() {
    'use strict';
 
    var re="www.jb51.net\/.*?";
    var getRe = GM_getValue('re', re);
    
    var reg = new RegExp(getRe,"g");

    //var resultQuery=document.getElementsByClassName('c-container');
       for(var i=1;i<11;i++)
       {

         var item=document.getElementById(i);
         var url=item.getElementsByClassName('c-showurl')[0];  
           url=url.innerHTML;
         
           if(reg.test(url))
           {
             
              item.remove();
           
           
               
       
           }
       }
    var s_tab=document.getElementById("s_tab");
    var inputFilter=document.createElement("input");
    inputFilter.setAttribute("id","inputFilter");
    inputFilter.setAttribute("placeholder","过滤域名");
    var filterButton=document.createElement("input");
    filterButton.setAttribute('type','submit');
    filterButton.setAttribute('value','过滤');
    filterButton.setAttribute('id','filter');
    //var inputFilter="<input id='inputFilter' placeholder='过滤域名'></input>";
    s_tab.appendChild(inputFilter);
    s_tab.appendChild(filterButton);
  document.getElementById("filter").addEventListener("click", filter );
    function filter(){
    var inputFilter=document.getElementById('inputFilter');
       // console.log(inputFilter.getAttribute('value'));
         re=re+"|"+inputFilter.value+"\/.*?";
        getRe=re;
        GM_setValue('re',getRe);
       
    }
    
   
    
    // Your code here...
})();