Tech Support Websites

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg
Showing posts with label Bookmarklet. Show all posts
Showing posts with label Bookmarklet. Show all posts

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?


Read More
Posted in Bookmarklet, Javascript | No comments

Sunday, 8 April 2012

Google Mobilizer Bookmarklet - view just text of web pages

Posted on 00:10 by Unknown
You can use Google Mobilizer application, when you need a mobile-friendly version of webpage. If you are on a low-bandwith Internet connection, Google Mobilizer can be used on a PC or laptop to view just the text (and optionally images).

When I'm on Twitter, I don't have a good feeling about clicking URL shortened links as they don't reveal the domain name and can lead you to spam. Ocassionally, I'm directed to web pages that have more ads than content. I also learnt the creepy fact that any site can find out if you are logged into social web sites.

http://datatransparency.wsj.com/

Considering these privacy, security & readability issues I faced, I wished there was a way to open all links in a web page with Mobilizer so that I can view a minimalist, text-only version of a web page. I wrote the Google Mobilizer Bookmarklet to scratch this itch.

The "prettified" code looks like this -
javascript:(function() {
    a = document.getElementsByTagName('a');
    for (i = 0; i < a.length; i++) {
        a[i].href = 'http://www.google.com/gwt/x?noimg=1&btnGo=Go&source=wax&ie=UTF-8&oe=UTF-8&u=' + encodeURIComponent(a[i].href);
        a[i].style.backgroundColor = '#f0f0f0';
    }
}())

To use the bookmarklet, drag & drop the following link to you Bookmarklet/Favorites bar - Mobilizer

Once you're on a page that has a lot of links (like Twitter), click on the Mobilizer bookmarklet & it will then set a light grey background color to all hyperlinks on that page & prepend the Google Mobilizer URL to them.

As the Google Mobilizer application works by taking a querystring as an input, it can be adapted to work like a search provider in Chrome & Opera, to simplify its use.  The string to use for configuring it is -
http://www.google.com/gwt/x?noimg=1&btnGo=Go&source=wax&ie=UTF-8&oe=UTF-8&u=%s

If you assign a letter like M to this app, you can type M in the Chrome address bar/omnibox & then the type the URL you would like to see via Google Mobilizer.

Related:
The Joy of Bookmarklets
View clutter-free web pages with TidyRead, Safari Reader
HOW TO block images/image ads originating from a specific domain in Firefox 4 & above
HOW TO block IFRAME based ads
Read More
Posted in Bookmarklet, Javascript, WebApps | No comments
Older Posts Home
Subscribe to: Posts (Atom)

Popular Posts

  • 10 ways to make laptop battery last longer
    Paraphrased from a Right Choice magazine article with my own opinions: Keep the brightness of the screen as low as possible. If portability ...
  • 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 ...
  • Manipulate PDF files for free with PDFRider
    PDFRider (currently in version 0.5) is an open source project on Codeplex. This utility provides a GUI for the command-line program  Pdftk ...
  • HOW TO try Windows Azure for free (without any credit card)
    Windows Azure, Microsoft's cloud platform offers .NET developers a great opportunity to extend their skills to this new platform. You do...
  • NDepend - a powerful .NET code analysis tool
    Nearly a decade ago, I was amazed when a not-so-technical project manager gave detailed feedback on my C# code in a project I was working on...
  • What does the "www" in a website URL mean?
    This NYTimes technical post explains it well: The “www” is a subdomain, a specific area within the domain, but not all sites will use it. I...
  • A new JavaScript Reference to bookmark
    For years, the JavaScript section at W3Schools.com has been a indispensable source of reference for me . It will now not be my only source. ...
  • HOW TO check what HTML5 features a browser supports
    Now that I'm getting my feet wet in HTML5, I thought I should spend more time with features that are supported by all popular browsers r...
  • Book Review: Don't Make Me Think
    The second edition of Don't Make Me Think by Steve Krug which came out in 2005 is a short 200-page stylish book on Web Usability. It ha...
  • Web apps in less than 10 KB
    There have been over 350+ submissions to the  10K Apart contest conducted by Microsoft & Event Apart that has a prize money of over $10...

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)
      • 10 ways to make laptop battery last longer
      • Learnings in S/W Engineering from the HealthCare.g...
      • TWIL - Week #29
      • MS currently has 21 apps on Google Play, incl. Wor...
      • Review: uCertify PMI PMP v-5 Online PrepKit
      • TWIL - Week #28
      • HOW TO highlight a Province within a Country with ...
      • My first impressions of Nexus 7 tablet
      • Free APIs, online services to generate screenshots...
      • TWIL - Week #27
      • HOW TO prevent mixed content warning in web pages
      • What's common between Kovid Goyal & Antony Lewis?
      • TWIL - Week #26
      • FB & Twitter spam me with similar subject line
      • Book Review: PMP Rapid Review by Sean Whitaker; MS...
      • Windows Azure Mobile Services - Error: Table 'some...
    • ►  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)
    • ►  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