It turns page.size() and page.setSize() methods are slightly
confusing since there multiple different sizes (layout size,
content size, viewport size..)
This patch renames Page.{size,setSize} methods into
Page.{viewportSize,setViewportSize} methods to avoid confusion.
This patch:
- renames phantomjs folder into phantom_shim
- moves bin/puppeteer into a phantom_shim/runner.js and
merges the file with phantomjs/index.js
- removes "bin" field from the package.json - it is confusing
to have phantom shim installable
Phantom shim requires a bunch of dependencies which are not needed by
the puppeteer itself.
This patch moves these dependencies to the devDependencies.
This patch adds docs/api.md file which contains API description
for the puppeteer API. This patch adds the API outline, which
doesn't not have explanations and samples.
This patch introduces check_availability.js utility which looks for
available chromium binaries for different revisions and platforms.
This patch also re-factors the chromium downloader scripts so that
it can operate different platforms.
This patch:
- moves phantom shim shell into a bin/ folder
- introduces a new root index.js which exposes Browser to the
dependent modules
- adds forgotten LICENSE header to the install.js
This patch implements Puppeteer's Page.setBlockedURLs method.
This is a less agile alternative to the phantom's request.abort()
api.
This patch also adds a loadurlwithoutcss.js example re-implementation
to illustrate the usage of Page.setBlockedURLs.
This patch implements:
- puppeteer's Page.printToPDF method. The method's defaults
are similar to phantom's defaults for the paperSize property.
- phantom's render into pdf file.
Certain examples rely extensively on the originating PhantomJS
examples.
This patch fixes license headers of these examples to mention
PhantomJS authors.
The PhantomJS has a similar callback called onInitialized. This
callback passes control to the automation script when the page
gets initialized.
To precisely implement this functionality atop of puppeteer,
and since puppeteer controller script lives in a separate process to
the page, we need an ability to pause page at the moment of
initialization. For now, we are not able to do this.
However, oftentimes clients want to evaluate certain code in
page at the point of page initialization. This patch implements
this capability with the Page.evaluateOnInitilized method call.
This patch also re-implements phantom's unrandomize.js example
with the puppeteer API. This is serves an illustration purpose
for the page.evaluateOnInitilized callback.
With this patch, page has two methods to include javascript:
- Page.addScriptTag(url) which is similar to phantom's includeJs.
- Page.injectFile(filePath) which is similar to phantom's injectJs.