title: CasperJS viewport & viewportSize not resizing browser
body: <p>Is anyone having any issues lately with the CasperJS or PhantomJS <code>viewport</code> or <code>viewportSize</code>?</p>
  
  <p>I've tried using</p>
  
  <pre><code>page.viewportSize = {width: 1280, height: 1024};
  casper.start()
        .viewport(800, 600);
  casper.options.viewportSize = {width: 1290, height: 1024};
  </code></pre>
  
  <p>No matter where I put them in the code the browser size still stays the default 300, 400.</p>
  
  <pre><code>/*jshint strict:false*/
  /*global CasperError, console, phantom, require*/
  
  var links = [];
  var casper = require("casper").create();
  var w = window.innerWidth;
  var h = window.innerHeight;
  
  
  function getLinks() {
      var links = document.querySelectorAll("h3.r a");
      return Array.prototype.map.call(links, function(e) {
          try {
              // google handles redirects hrefs to some script of theirs
              return (/url\?q=(.*)&amp;sa=U/).exec(e.getAttribute("href"))[1];
          } catch (err) {
              return e.getAttribute("href");
          }
      });
  }
  
  casper.options.viewportSize = {width: 1600, height: 950};
  
  casper.start("http://google.fr/", function() {
      // search for 'casperjs' from google form
      this.viewport(900, 800);
      this.fill('form[action="/search"]', { q: "casperjs" }, true);
  });
  
  casper.then(function() {
      // aggregate results for the 'casperjs' search
      links = this.evaluate(getLinks);
      // now search for 'phantomjs' by fillin the form again
      this.fill('form[action="/search"]', { q: "phantomjs" }, true);
  });
  
  casper.then(function() {
      // aggregate results for the 'phantomjs' search
      links = links.concat(this.evaluate(getLinks));
  });
  
  
  console.log("Height==&gt; " + h);
  console.log("Width==&gt; " + w);
  
  
  casper.run(function() {
      // echo results in some pretty fashion
      this.echo(links.length + " links found:");
      this.echo(" - " + links.join("\n - "));
      this.exit();
  });
  </code></pre>