Snippet: eval window

Here is a very usefull which you can put in a link in your () 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 ='','','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:

  1. Copy the code above to the clipboard
  2. Add this page to your bookmarks – in the link area.
  3. Edit the bookmark, replacing the URL with the copied code on the clipboard
  4. 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.


Leave a Reply