Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.
You've got two main options:
| var page = new WebPage(), | |
| address, output, size; | |
| //capture and captureSelector functions adapted from CasperJS - https://github.com/n1k0/casperjs | |
| capture = function(targetFile, clipRect) { | |
| var previousClipRect; | |
| var clipRect = {top: 0, left:0, width: 40, height: 40}; | |
| if (clipRect) { | |
| if (!isType(clipRect, "object")) { | |
| throw new Error("clipRect must be an Object instance."); |
| /* | |
| Copyright (c) 2011, Mads A. Elvheim | |
| All rights reserved. | |
| Redistribution and use in source and binary forms, with or without | |
| modification, are permitted provided that the following conditions are met: | |
| * Redistributions of source code must retain the above copyright | |
| notice, this list of conditions and the following disclaimer. | |
| * Redistributions in binary form must reproduce the above copyright | |
| notice, this list of conditions and the following disclaimer in the |