-1

Can I change the screen resolution in nightmarejs? (Not a viewportSize)

For example, how it works in Casperjs:

var casper = require("casper").create({
    onPageInitialized: function (page) {
        page.evaluate(function () {
            window.screen = {
                width: 1920,
                height: 1080
            };
        });
    }
});

Many thanks!

Noneme
  • 23
  • 4
  • Check the screen resolution: whatismyscreenresolution.com will give me my screen's resoltion, this is not helpful link, would you add image to explain more what you are talking about, and add your trial code... – Parag Bhayani Jun 27 '16 at 13:47

2 Answers2

0

(This answer is pulled from my original answer in Nightmare #699.)

I'm not certain, but I don't think so, at least not directly. Electron's screen resolution depends on the framebuffer it's rendering to. You could use something like xvfb-run to alter the framebuffer (#224 touches on this, although for an entirely different reason).

Without more information, it's tough to answer your question. If you provide more information about what you're trying to accomplish, I'll update this answer.

Ross
  • 2,448
  • 1
  • 21
  • 24
0

Nightmare is based on electron. Refer similar question and my answer here

devilpreet
  • 749
  • 4
  • 18