Comments (7)
The default in this case is 800 x 600
. We just thought 1440 x 900
is a more sensible default. Open for discussion!
from chromeless.
@schickling can auto sizing be done using window.innerHeight
and window.innerWidth
in headless instead of setting a default?
from chromeless.
You setting this inside of a .evaluate
call? I don't see the advantage of this approach over setting the viewport
in the constructor?
from chromeless.
@schickling I'm wondering if it possible to do full height, when it's an unknown.
from chromeless.
You probably first need to find out the height using an .evaluate
call and then use the .viewport
method.
from chromeless.
@schickling That's what I saw was being done here but not when isHeadless
is true. Tried something like this, but renders a white image.
const screenshot = await chromeless
.goto('https://www.graph.cool')
.evaluate(async () => {
const height = window.innerHeight;
const width = window.innerWidth;
await chromeless.viewport(width, height);
})
.screenshot()
from chromeless.
What you want here (at least for the mean time) is to:
I think evaluate doesn't pass anything but what is returned to it, so screenshot would get a blank image.
const evalstuff= await chromeless
.goto('https://www.graph.cool')
.evaluate(async () => {
const height = document.body.scrollHeight; //This gets the whole scrolled window height.
const width = window.innerWidth; // You probably don't need this.
return {width:width, height:height}
})
then you call:
const data = await evalstuff
const screenshot = await chromeless
.setViewport({deviceScaleFactor: 0, scale: 1, fitWindow: true, width: data.width , height: data.height})
.screenshot()
This worked for me, at least, putting here for others in the same boat.
from chromeless.
Related Issues (20)
- How can I manipulate multiple tabs?
- Lookup IOT Endpoint as part of deploy
- .evaluate() is not returning all dom elements
- Is there a way to change the Lambda function names? For example chromeless-serverless-1-dev-run
- Setup example repo seems to not work with AWS bucket HOT 1
- Could not run multiple chromeless on same AWS account and region
- How to run chromeless directly (no proxy) in AWS Lambda + serverless? HOT 3
- How can I create/record video of a webpage or use ffmpeg to do so? HOT 1
- Is it possible to use promises instead of async await? HOT 1
- Add support for flatMap
- --proxy-server setting on local Chromeless does not work for authenticated proxies HOT 1
- Chromeless ScrollTo not Working as Expected
- Ability to clip screenshots
- Fully Deployed On Lambda HOT 1
- How to change the S3 bucket and location HOT 1
- Full screen on Headless Lambda
- "ChromeLauncher Killing all Chrome Instances" unexpectedly
- Unable to start Chrome: Error occured in serverless-plugin-chrome wrapper when trying to ensure Chrome for default() handler. { functions: [ 'run' ], flags: [] } HOT 2
- Chromeless scripts interact together when launched in the same window
- Can i use custom extensions with Chromeless?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chromeless.