SourceGrab - Class to get the source code of the active browser window
Posted: 13 Aug 2015, 14:10
This is a class to enable you to easily pull information from the source code of the active browser window.
- Works by sending keystrokes (Ctrl-U, Ctrl-A, Ctrl-C) and will close the view source window once it has copied the source.
- Currently works with Firefox, Chrome and IE
- Example included which pulls the HTML DocType from the source of the active window when you hit F12, and types the DocType when you hit F11
- Shows a confirmation dialog to let you know if it successfully grabbed the source.
- Restores the state of the clipboard after use