<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d8211560\x26blogName\x3dTech+Tips,+Tricks+%26+Trivia\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dBLUE\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttps://mvark.blogspot.com/search\x26blogLocale\x3den\x26v\x3d2\x26homepageUrl\x3dhttp://mvark.blogspot.com/\x26vt\x3d601588505461698440', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Tech Tips, Tricks & Trivia

by 'Anil' Radhakrishna
An architect's notes, experiments, discoveries and annotated bookmarks.

Search from over a hundred HOW TO articles, Tips and Tricks

HOW TO make Google skip redirection step on clicking search result

There have been times when I wanted to just copy the URL of a site mentioned in a Google search result without having to go to the website & then copying it from the address bar.

However when I right click & copy the URL, this is how the address typically looks -

(URL broken with new lines for readability & to preserve formatting)

Digging into the source code reveals that there is a mousedown event that fires up when the link is accessed & re-creates the HREF of that anchor tag so that you have to pass through a quick additional Google step before you can reach the search result site

I wished there was a bookmarklet that could stop Google from mangling the URL and skip the redirection step. Guess what, there is bookmarklet Zap Events that can remove all JavaScript events assigned to elements in a web page.

It only zaps the following 4 events - "mouseover","mouseout","unload","resize". I tweaked the code a bit to include the "mousedown" event as well -


(remove  ^ & newline character when you're using this code)

With this modified bookmarklet, I can now copy the actual URL in a Google Search result.

Update 5/Sept/12: Found that this redirection feature bugs a lot of people. This thread on the StackExchange WebApps forum has simpler bookmarklet code to address this issue:

javascript:function rwt(a,f,g,l,m,h,c,n,i){return a};


Labels: ,

Tweet this | Google+ it | Share on FB

« Home | Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »


Post a Comment