View source with a bookmarklet

Written by Shanx May 28th, 2003

View source with a bookmarklet

Continue reading →
Close

Some websites try the somewhat lame technique of using Javascript based “obfuscation” for their HTML. At other times, IE will just refuse to view source if your system is low on memory (according to IE’s reckoning that is) or if your temp space is full. Here is a handy bookmarklet to view source in any browser.

Some websites try the somewhat lame technique of using Javascript based “obfuscation” for their HTML. At other times, IE will just refuse to view source if your system is low on memory (according to IE’s reckoning that is) or if your temp space is full. Following are a couple of handy bookmarklets to view source in any browser.

IE View Source
Drag this link to your browser bar

The following bookmarklet will work with any browser on any platform using the view:source directive. It prompts you for the URL you wish to view source of (defaults to the current URL for convenience) and opens the usual source viewer associated with your browser. Note that this may not work for non-IE browsers on Macs (because Mac doesn’t support the view:source directive) so you will be forwarded to http://sniptools.com/viewsource/ instead which shows you the text.

Generic View Source
Drag this link to your browser bar

Posted in Miscellaneous

10 Comments

Tagged with

10 Comments

  1. mandy says:

    In Mozilla, you can use the DOM inspector.

    (1) Open page in Mozilla DOM Inspector.
    (2) Right click on top node.
    (3) Copy XML.
    (4) Paste in text editor.

    It’s that simple!

  2. sniptools says:

    Thanks Mandy, didn’t know about that!

  3. tripleaxis says:

    love the IE View source link. good idea :)

  4. CodeHouse.com says:

    Hi,

    “IE View Source” is almost identical our DHTML Snoop: http://www.codehouse.com/javascript/favelets/dhtml_snoop/

    The “Generic View Source” bookmarklet is a good idea, yet I think it might be better if it automatically brought up the page without the prompt dialog, like “IE View Source.” I had actually tried to do this myself at one point, but ran out of time and patience, and so put it on the back burner.

  5. sniptools says:

    Thanks for the link, Codehouse. The GENERIC VIEW SOURCE is easily modified I imagine to remove the PROMPT, given that the audience for this kind of stuff is most likely tech-literate. Interesting website btw.

  6. CodeHouse.com says:

    Thank you. You’re quite welcome for the link. I often post stuff for the website when half asleep, which may account for why I had difficulty getting the view-source favelet to work, but I do remember it being problematic. Provided nobody beats me to the punch, I will try to tackle the problem again later this month. One problem with using the view-source URL prefix is that Opera doesn’t support it. I haven’t tested whether Safari does. My hunch is not.

  7. CodeHouse.com says:

    Hi. Made a view-source favelet without the prompt, in case anyone’s interested.

    http://www.codehouse.com/javascript/favelets/view_source/

  8. Hgh says:

    Hi, Thank you for such an infromative website. Very interesting and easy to comprehend! Thanx!

  9. Prasad says:

    why Generic view source code is not working in windows XP. please send me answer asap

  10. sniptools says:

    Prasad, if you have SP2 installed, your IE may be hardened beyond what you expect it to. Please make sure the popup blocker is not blocking. The bookmarklet is setup to show page source in a NEW WINDOW, so it requires a popup, technically. Works on IE here for me, even with Maxthon or Slimbrowser skins.

Leave a Reply

Miscellaneous

I use the Nokia e61i as my mobile. Instead of my telco’s data plan (which offers me a meagre 1GB per month) I simply prefer to use my home wireless [...]

Continue reading →

View all

Web Tools

If you use Firefox (and if not, what are you waiting for?) you are familiar with useful extensions such as Video Downloader, which allow you to save local copies of [...]

Continue reading →

View all

Databases

This regexp worked for me. SELECT * FROM table WHERE NOT column ~ ( ‘^(‘|| $$[\09\0A\0D\x20-\x7E]|$$|| — ASCII $$[\xC2-\xDF][\x80-\xBF]|$$|| — non-overlong 2-byte $$\xE0[\xA0-\xBF][\x80-\xBF]|$$|| — excluding overlongs $$[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}|$$|| — straight 3-byte [...]

Continue reading →

View all

Windows

So you’ve been visited by the much dreaded CRC — Cyclical Redundancy Check error, most likely encountered while copying files between hard disks. On Mac OSX, this will usually appear [...]

Continue reading →

View all

Mac OSX

A simple app ought to do it. Download iRinger. It’s a Windows app. If you’re on Mac, you’ll want to use it within a virtual machine, like Parallels or VMWare [...]

Continue reading →

View all

System Maintenance

I use the Nokia e61i as my mobile. Instead of my telco’s data plan (which offers me a meagre 1GB per month) I simply prefer to use my home wireless [...]

Continue reading →

View all

Wordpress

Among many new exciting features, WordPress 2.6 released the ability to store each and every revision of your posts, like an elaborate update history. Now this can be a pretty [...]

Continue reading →

View all

Audio/Video

Panic, the makers of some fantastic software such as Transmit or Panic, also have the most light-weight audio converter for the Mac OSX platform. It’s called Audion: get it here. [...]

Continue reading →

View all

iPhone

A simple app ought to do it. Download iRinger. It’s a Windows app. If you’re on Mac, you’ll want to use it within a virtual machine, like Parallels or VMWare [...]

Continue reading →

View all