LucianoGanga / simple-headless-chrome

Simple abstraction to use Chrome as a Headless Browser with Node JS
MIT License
217 stars 50 forks source link

saveScreenshot clip param doesn't work #80

Open BobLuo opened 7 years ago

BobLuo commented 7 years ago

When I clip a region screenshot user api saveScreenshot, but the result also get full screenshot.

await mainTab.goTo(url)

// Resize the viewport to full screen size (One use is to take full size screen shots)
await mainTab.resizeFullScreen()

// Wait some time! (2s)
await mainTab.wait(2000)

const regionClip = {
      x: 0,
      y: 0,
      width: 500,
      height: 500,
      scale: 1
};
    await mainTab.saveScreenshot('/test', {clip:regionClip })
LucianoGanga commented 7 years ago

Hello @BobLuo !

Can you try running the tests and check if in the test the same happens to you?

Just go into the module folder and run npm run test. You should see new files in the test folder with some screenshots.

Thanks! Luciano

Wisam82 commented 7 years ago

Hello @LucianoGanga .

I am having the same problem with the above ^. I am running the npm test but getting the full screen shot in my test folder. did this got resolved or is there any work around?

Thank you, Wisam

obicke commented 6 years ago

Yeah, it seems as though it is just getting ignored.

obicke commented 6 years ago

To be clear, one can get the fullpage screen capture using fullPage as in

mainTab.saveScreenshot('/test', {fullPage:true})

However, when trying to implement clip to limit screencapture to smaller area, it seems to be ignored.