View Selection Source – Google Chrome Extension

View Selection Source - Google Chrome ExtensionAfter many years with Opera as my primary browser, I’ve partly started to use Google Chrome as it’s rather fast and the UI is really sweet. Google Chrome has got some very useful tools for webdevelopers, but I was surprised that there was no ‘View Selection Source’ item in the context menu. I’ve therefore decided to port my User JavaScript which allows you to see the source of a selected part of a page, originally developed for Opera, to Google Chrome as an extension (which turned out to be surprisingly easy).

The Chrome extension API doesn’t allow you to add items to the context menu (yet?), so after installation, there is an icon next to the address bar which you can click to display the source code. If you don’t like the default Mozilla-like color scheme of syntax highlighting, you can go to the Options page and choose the Desert one instead.

Download

You can install it either from the Google Chrome extensions gallery or as a bookmarklet:

Screenshots

Custom Color Schemes

If you feel like creating a new color scheme, here is how the CSS code looks like. Hope the class names are descriptive enough:

#desert body {
	background: #333;
	color: #fff;
}
#desert .tag {
	color: #BDB76B;
}
#desert .entity {
	font-weight: bold ;
}
#desert .tagName {
	color: #BDB76B;
	font-weight: normal;
}
#desert .attrName {
	color: #BDB76B;
	font-weight: normal;
}
#desert .attrValue {
	color: #FFA0A0;
	font-weight: normal;
}
#desert .quote {
	color: #FFA0A0;
	font-weight: normal;
}
#desert .comment, .comment *  {
	color: #87CEEB !important ;
	font-weight: normal !important ;
}
#desert .cdataMark {
	color: #ff6600;
	font-weight: bold;
}
#desert .cdataContent, .cdataContent *  {
	color: #ff6600 !important ;
	font-weight: normal !important ;
}

Once you’ve created one, don’t forget to send it to me so that I can build it into the extension!

2 Responses to “View Selection Source – Google Chrome Extension”

  1. PUBLOG » View Selection Source for Opera Says:

    [...] Now available also as a Google Chrome extension. [...]

  2. caixa Says:

    I have been exploring for a little for any high-quality articles or weblog posts in this sort of space . Exploring in Yahoo I at last stumbled upon this site. Reading this info So i am satisfied to express that I have an incredibly just right uncanny feeling I came upon exactly what I needed. I such a lot definitely will make sure to don?t disregard this web site and provides it a glance regularly.

Leave a Reply