Tech Support Websites

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Tuesday, 28 August 2012

HOW TO make Google skip redirection step on clicking search result

Posted on 09:50 by Unknown

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 -
http://www.google.com/url?sa=t&rct=j&q=menu_elements_selector
&source=web&cd=5&cad=rja&ved=0CEIQFjAE
&url=http%3A%2F%2Fapi.jquery.com%2Fattribute-ends-with-selector%2F
&ei=LdQ8UKOkJYPTrQfn0IHIDA
&usg=AFQjCNFmICOvDtxuImTTeXY3pCDQNW6yVQ

(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 -

javascript:(function(){var%20H=^
["mouseover","mouseout","unload","resize","mousedown"],^
o=window.opera;%20if(document.addEventListener/*MOZ*/&&!o)^
%20for(j%20in%20H)^
{document.addEventListener(H[j],function(e)^
{e.stopPropagation();},true);}^
%20else%20^
if(window.captureEvents/*NS4*/&&!o)%20{%20^
document.captureEvents(-1/*ALL*/);^
for(j%20in%20H)^
{window["on"+H[j]]=null;}}%20else/*IE*/%20{function%20R(N)^
{var%20i,x;for(j%20in%20H)^
if(N["on"+H[j]]/*NOT%20TEXTNODE*/)N["on"+H[j]]=null;^
for(i=0;x=N.childNodes[i];++i)R(x);}R(document);}})()

(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};

Related:
  • JavaScript Bookmarklet Builder
  • Google Mobilizer Bookmarklet - view just text of web pages
  • Is there a no-javascript version of search?


Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in Bookmarklet, Javascript | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Windows 8 keyboard shortcuts
    Win + X   - context menu to access common features like Control Panel, Task Manager, File Explorer, Programs & Features, Run, Search etc...
  • What is the difference between Browser Mode & Document Mode in IE
    If you're a web developer and your job actively involves building web pages that work the same in all browsers including the last three ...
  • My 30-day personal project - watch 100 hours of Pluralsight videos
    Inspired by Matt Cutts' 30-day challenges , I plan to watch 100 hours of Pluralsight online videos to get up-to-date with current ...
  • Archive tweets & favorites with Google Reader
    There are numerous ways to archive tweets but rather than use yet another tool, I prefer using Google Reader to preserve the tweets I mark ...
  • TWIL - Week #3
    This Week I Learned: New Azure VM Image Templates include SQL Server, BizTalk Server, and SharePoint Server (2013?) images . This can be han...
  • Dashboard-like info with Browser tabs, Windows 7 Taskbar tabs
    Browser tabs & Windows 7 Taskbar tabs are turning self-aware.  This is how my browser looked the other day: I had the summary of all tha...
  • The State Of HTML5 Video
    Key points from the  The State Of HTML5 Video  report by LongTailVideo (last updated on April 19, 2012): 75% of the desktop & mobile bro...
  • Azure in Pictures - overview of Windows Azure Features, Services and Common Uses
    Download the Windows Azure Poster in PDF format (1.1MB)
  • Indian comparison shopping sites
    Did you know, India has 120 million Internet users & the Indian e-commerce market is worth $7 billion ?  Travel accounts for over 80 per...
  • Things to consider before settling on a JavaScript Library or jQuery plugin for your project
    In the article, Which JavaScript Library Should I Pick? , Pamela Fox has listed some practical points to consider before you settle on a Jav...

Categories

  • AJAX
  • Android
  • APIs
  • App
  • ASP
  • ASP.NET
  • ASP.NET-MVC
  • Azure
  • Azure SQL Database
  • AzureInPictures
  • Bing
  • Book Review
  • Bookmarklet
  • Browsers
  • C#
  • chart
  • Chrome
  • Cloud
  • CSS
  • CSS3
  • DidYouKnow
  • E-Commerce
  • Excel
  • FB
  • Fiddler
  • Firefox
  • Gadgets
  • GeoLocation
  • GMail
  • Google
  • Google Docs
  • Google Reader
  • Health
  • Hotmail
  • HOWTO
  • HTML
  • HTML/CSS
  • HTML5
  • Humor
  • Hyderabad
  • IE
  • IIS
  • India
  • Internet
  • IT
  • Javascript
  • jQuery
  • JSON
  • JSONP
  • Laptop
  • Learning Resources
  • Lists
  • Map
  • Metrics
  • Microsoft
  • miscellaneous
  • Mobile
  • NAPA
  • Office365
  • Opera
  • PDF
  • Performance
  • Personal
  • PHP
  • PM
  • PowerShell
  • Privacy
  • Programming
  • Rant
  • Safari
  • Science
  • Search Engines
  • SearchEngines
  • Security
  • SEO
  • Sharepoint
  • SharePoint2013
  • Silverlight
  • Software Engineering
  • Solutions
  • SQL Azure
  • SQL Server
  • TFS
  • Tip
  • Tips
  • Tools
  • Tools/Utilities
  • Trivia
  • TWIL
  • Twitter
  • UX
  • VM
  • VS.NET
  • VS2010
  • VS2012
  • WCF
  • WebApps
  • Websites
  • WF
  • Windows Phone
  • Windows7
  • Windows8
  • Word
  • WP7
  • WPF

Blog Archive

  • ►  2013 (112)
    • ►  October (16)
    • ►  September (14)
    • ►  August (8)
    • ►  July (8)
    • ►  June (13)
    • ►  May (12)
    • ►  April (12)
    • ►  March (8)
    • ►  February (15)
    • ►  January (6)
  • ▼  2012 (127)
    • ►  December (11)
    • ►  November (14)
    • ►  October (13)
    • ►  September (14)
    • ▼  August (16)
      • Store your videos on SkyDrive and Google Drive & a...
      • HOW TO make Google skip redirection step on clicki...
      • What is Inbound Marketing?
      • IE10 - first browser to auto-correct text while yo...
      • "Hidden" features in Google products
      • HOW TO quickly save all URLs in tabs within a IE o...
      • "The Best Programming Advice I Ever Got"
      • Windows 8 keyboard shortcuts
      • Which Windows 8 edition is right for me?
      • QR Codes and MS Tags can connect books to online m...
      • How YouTube, Wikipedia use machine moderation for ...
      • Browse Feeds hands-free with Google Reader Play
      • HOW TO prevent Skype from auto-starting after Wind...
      • HOW TO download multiple documents in a SharePoin...
      • Free 42 episode video series on HTML5, CSS3, JavaS...
      • Twitter Search Tricks
    • ►  July (16)
    • ►  June (6)
    • ►  May (5)
    • ►  April (11)
    • ►  March (12)
    • ►  February (7)
    • ►  January (2)
  • ►  2011 (98)
    • ►  December (5)
    • ►  November (2)
    • ►  October (5)
    • ►  September (7)
    • ►  August (7)
    • ►  July (15)
    • ►  June (10)
    • ►  May (7)
    • ►  April (8)
    • ►  March (10)
    • ►  February (11)
    • ►  January (11)
  • ►  2010 (163)
    • ►  December (14)
    • ►  November (19)
    • ►  October (19)
    • ►  September (15)
    • ►  August (18)
    • ►  July (17)
    • ►  June (20)
    • ►  May (17)
    • ►  April (19)
    • ►  March (5)
Powered by Blogger.

About Me

Unknown
View my complete profile