Results 1 to 6 of 6
  1. #1
    Grooguz
    Grooguz is offline
    BanHammer Holder
    Grooguz's Avatar
    Join Date
    2010 May
    Posts
    678
    Thanks Thanks Given 
    152
    Thanks Thanks Received 
    537
    Thanked in
    167 Posts
    Rep Power
    14

    [JS] Remove tracking and instant preview from Google

    Hi all,
    I need simple JS script to remove google instant preview in search result (annoying popup with site image near each search result). Entire content in these divs:
    <div class="vspib"
    <div id="bfoot">

    Thanks for help

  2. #2
    DarkT
    DarkT is offline
    Member-in-training DarkT's Avatar
    Join Date
    2012 Jan
    Posts
    116
    Thanks Thanks Given 
    60
    Thanks Thanks Received 
    103
    Thanked in
    30 Posts
    Rep Power
    0
    lol just go to google.com go to options, search settings ,never show instant results!

  3. #3
    Grooguz
    Grooguz is offline
    BanHammer Holder
    Grooguz's Avatar
    Join Date
    2010 May
    Posts
    678
    Thanks Thanks Given 
    152
    Thanks Thanks Received 
    537
    Thanked in
    167 Posts
    Rep Power
    14
    Quote Originally Posted by DarkT View Post
    go to google.com go to options,
    Was my question about "options"? NO! It was about JS

  4. #4
    rodoxfnx
    rodoxfnx is offline
    Banned
    Join Date
    2011 Dec
    Posts
    281
    Thanks Thanks Given 
    48
    Thanks Thanks Received 
    745
    Thanked in
    77 Posts
    Rep Power
    0
    Code:
    // ==UserScript==
    // @name           Disable Instant Preview
    // @namespace      http://*.google.*/*
    // @include        http://*.google.*/*
    // ==/UserScript==
     
    //*************************************************************************
    // Script to make Instant Preview work the way it was designed to.
    //
    // According to the documentation, it is supposed to show the preview ONLY
    // if the preview icon is clicked. In reality, it shows the preview when
    // any part of the search result is clicked.
    //*************************************************************************
     
    setTimeout(function(){
        unsafeWindow.disable_instant_preview = true;
     
        var divs = document.getElementsByTagName("div");
        for (var key in divs)
        {
            var e = divs[key];
            if (e.getAttribute('class') == 'vspi' || e.getAttribute('class') == 'vsc')
            {
                // register a listener so that if the BUTTON is clicked (and nothing else) we get the preview
                e.addEventListener('click', function(evt) {
                    // Toggle preview if the preview button itself is pressed
                    if (evt.target.getAttribute('class') == 'vspib')
                    {
                        unsafeWindow.disable_instant_preview = !unsafeWindow.disable_instant_preview;
                    }
                    if (unsafeWindow.disable_instant_preview && evt.target.tagName != 'A' && evt.target.tagName != 'BUTTON')
                    {
                        evt.stopPropagation(); // don't let google have it
                    }
                }, true);
            };
        }
     
        // And finally, allow ourselves to re-disable it by clicking on the x
        document.getElementById("vspci").addEventListener('click', function() {
            unsafeWindow.disable_instant_preview = true;
        }, true);
     
        // because the preview is a lot like a bubble, when the relevant area
        // loses focus, we should kill it.
        document.getElementById("res").addEventListener('blur', function() {
            unsafeWindow.disable_instant_preview = true;
        }, true);
     
    }, 10);
    GraseMonkey Script

    Altought Google is f....... business, i hate this instant preview so much aswell ;0

    http://www.countinfinity.com/blog/20...stant-preview/

    I have found this sometime ago, hope this can help you somehow.

    Main idea was from this guy http://userscripts.org/scripts/review/90222
    Last edited by rodoxfnx; 2012-02-16 at 10:46 AM.

  5. The Following User Says Thank You to rodoxfnx For This Useful Post:


  6. #5
    Dwar
    Dwar is offline
    Veteran Dwar's Avatar
    Join Date
    2010 Mar
    Posts
    2,222
    Thanks Thanks Given 
    211
    Thanks Thanks Received 
    2,230
    Thanked in
    292 Posts
    Rep Power
    10
    Thanks, I've finally updated my old opera, which was modified and tuned, and lost some features. So I also get a problem with instant preview... truly annoying.

    ---------- Post added at 03:54 PM ---------- Previous post was at 02:47 PM ----------

    Full script for Opera (based on danei's script). Will remove tracking and instant preview:
    Code:
    // ==UserScript==
    // @name           Remove Google Redirect
    // @include        http://www.google.*/*
    // @include        https://www.google.*/*
    // @include        http://ipv6.google.*/*
    // @include        https://ipv6.google.*/*
    // @include        http://encrypted.google.com/*
    // @include        https://encrypted.google.com/*
    // @include        http://news.google.*/*
    // @include        https://news.google.*/*
    // @run-at         document-start
    // based on http://userscripts.org/scripts/review/117942
    // ==/UserScript==
    
    document.addEventListener('DOMNodeInserted',checksearch,false);
    function checksearch()
    {
    	var list=document.getElementById('ires');
    	if(list)
    	{
    		document.removeEventListener('DOMNodeInserted',checksearch,false);
    		document.addEventListener('DOMNodeInserted',clear,false);
    	}
    	if(window.location.hostname.match(/news\.google\..+/))
    	{
    		document.removeEventListener('DOMNodeInserted',checksearch,false);
    		document.addEventListener('DOMNodeInserted',clearnews,false);
    	}
    	
    }
    function repaire_link(node)
    {
    	node.removeAttribute('onmousedown');
    	var orihref=node.getAttribute('originalhref');
    	if(orihref)
    	{
    		if(node.href!=orihref)
    			node.href=orihref;
    		return;
    	}
    	var regex=
    	[
    		/^(.+url\?q=)(.+)(&sa=.+)$/,
    		/^(.+&url=)(.+)(&ei=.+)$/,
    		/^(.+url\?url=)(.+)(&rct=.+)$/,
    		/^(.+&url=)(.+)$/
    	];
    	for(var i=0;i<regex.length;++i)
    	{
    		var realhref=node.href.replace(regex[i],function(str,p1,p2,p3){return p1&&p3?p2:null});
    		if(realhref&&realhref!=node.href)
    		{
    			node.href=unescape(realhref);
    			return;
    		}
    	}
    }
    function clear()
    {
    	var list=document.getElementById('ires');
    	if(list)
    	{
    		items=list.getElementsByTagName('a');
    		for(var i=0;i<items.length;++i)
    		{
    			repaire_link(items[i]);
    		}
    				
    	}
    	
    	var el = document.getElementById('bfoot');
    	el.parentNode.removeChild(el);
    }
    function clearnews()
    {
    	function _clear(event)
    	{
    		var node=event.target;
    		if(!node||event.attrName!='href')return;
    		repaire_link(node);
    	}
    	var items=document.getElementsByTagName('a');
    	for(var i=0;i<items.length;++i)
    	{
    		items[i].addEventListener('DOMAttrModified',_clear,false);
    		//repaire_link(items[i]);
    	}
    }
    Please, post your questions on forum, not by PM or mail

    I spend my time, so please pay a little bit of your time to keep world in equilibrium

  7. The Following User Says Thank You to Dwar For This Useful Post:


  8. #6
    rodoxfnx
    rodoxfnx is offline
    Banned
    Join Date
    2011 Dec
    Posts
    281
    Thanks Thanks Given 
    48
    Thanks Thanks Received 
    745
    Thanked in
    77 Posts
    Rep Power
    0
    Thanks Sweeeeeeeeet.

Similar Threads

  1. [Dev] How to remove GameGuard in Aika
    By Ulquiorra in forum Aika Online
    Replies: 3
    Last Post: 2011-12-28, 03:20 PM
  2. how to remove Xtrap
    By simpletouch in forum Anti-Cheat Systems
    Replies: 4
    Last Post: 2010-12-02, 04:09 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •