Here is a very usefull javascript snippet which you can put in a link in your (MSIE) browser. It opens a new window from where you can execute javascript in the context of the parent window. Very usefull! Here is the snippet code:
javascript:void(eval("var s = '<script type=\"text/javascript\">function doEval(s) { opener.eval(s); }</script>';s+='<textarea rows=10 cols=80 id=source></textarea><br /><input type=button value=Eval onclick=\"doEval(source.value)\" />';window.w = window.open('','','width=700,height=210');window['w'].document.write(s);window['w'].document.title='Debug window'"))
To add this snippet to your browser follow these steps:
- Copy the code above to the clipboard
- Add this page to your bookmarks – in the link area.
- Edit the bookmark, replacing the URL with the copied code on the clipboard
- Save, while accepting any warnings about protocol
Using it is simple. When you are on a website you simply – press the link just created, and you get a new window in which you may execute javascript. The script will run in the context of the original window so you may explore the DOM and any other relevant information.