Comments (13)
Well! I finally got some time to do this.
I made a few changes in the way the screenshots are taken, because the Chrome DevTools Protocol deprecated some methods.
So I finally came with this example:
https://github.com/LucianoGanga/simple-headless-chrome/blob/master/examples/screenCapture.js
Where you can take screenshots in headless mode again, and besides that it receives a parameter "fullPage" (to take full page screens, as you can imagine) or "selector", where you get a screenshot of the area of a selector you pass.
I hope this helps you with the issue, and please let me know.
Everything is in v4.3.0 of this module.
I'll close the issue, but please feel free to reopen it if something doesn't work :)
Cheers!
Lucho
from simple-headless-chrome.
Hey Luciano,
Thanks so much for getting back to me. I tried running my example with the newest version and also tried replicating your example. Both of which threw this error:
ERROR! { Error: Invalid parameters (fitWindow: boolean value expected)
I don't believe I can re-open issues that you have closed.
from simple-headless-chrome.
from simple-headless-chrome.
Yup!
from simple-headless-chrome.
Also related to this issue - while I was trying to debug this problem, I tried passing the flag:
'--window-size=1280,1696'
to the browser instance, but it didn't seem to change anything while running headless (in regards to window visibility).
const browser = new HeadlessChrome({
headless: true,
chrome: {
flags: [
'--window-size=1280,1696'
]
}
})
from simple-headless-chrome.
from simple-headless-chrome.
I am using chrome version 59.0.3071.115.
I'll take a look at Browser.js in the meantime - thanks for your time Luciano
from simple-headless-chrome.
Hi! I can't test with that chrome version as I have the v60.0.3112.90
About the issue:
ERROR! { Error: Invalid parameters (fitWindow: boolean value expected)
When I released v4.3.0 I removed the property fitWindow
because it's deprecated in the last version of the protocol, but when I ran the tests on Travis CI, with the Stable version of Chrome, it gave me that error. So I fixed adding back that property in the options, and the tests passed.
If I were you, I'd double check that the installed version of the module is 4.3.1, just in case.
About the size. Did you have some luck?
Tip: You can always run the code with the env variable DEBUG="HeadlessChrome:*"
to see the module logs.
Cheers!
Lucho
from simple-headless-chrome.
Im getting the same error. Im using chrome Version 60.0.3112.90
ERROR! { Error: Invalid parameters (fitWindow: boolean value expected)
at /Users/fusionx1/Projects/pantheon/automation/node_modules/chrome-remote-interface/lib/chrome.js:90:30
at Chrome.handleMessage (/Users/fusionx1/Projects/pantheon/automation/node_modules/chrome-remote-interface/lib/chrome.js:289:13)
at WebSocket.<anonymous> (/Users/fusionx1/Projects/pantheon/automation/node_modules/chrome-remote-interface/lib/chrome.js:266:27)
at emitTwo (events.js:106:13)
at WebSocket.emit (events.js:194:7)
at Receiver._receiver.onmessage (/Users/fusionx1/Projects/pantheon/automation/node_modules/ws/lib/WebSocket.js:143:54)
at Receiver.dataMessage (/Users/fusionx1/Projects/pantheon/automation/node_modules/ws/lib/Receiver.js:385:14)
at extension.decompress (/Users/fusionx1/Projects/pantheon/automation/node_modules/ws/lib/Receiver.js:354:40)
at _inflate.flush (/Users/fusionx1/Projects/pantheon/automation/node_modules/ws/lib/PerMessageDeflate.js:279:12)
at afterWrite (_stream_writable.js:383:3)
at onwrite (_stream_writable.js:374:7)
at afterTransform (_stream_transform.js:79:3)
at TransformState.afterTransform (_stream_transform.js:54:12)
at Zlib.callback (zlib.js:625:5)
response:
{ code: -32602,
message: 'Invalid parameters',
data: 'fitWindow: boolean value expected' } }```
from simple-headless-chrome.
@fusionx1 , can you submit an example?
Make sure you have the latest version installed (and install it through NPM)
Thanks!
Lucho
from simple-headless-chrome.
I am running: Chromium 60.0.3112.113 and getting the same error about fitWindow
from simple-headless-chrome.
from simple-headless-chrome.
Done! fitWindow problem fixed in 4.3.9!
I could finally reproduce the issue and fix it. Thanks @fusionx1 for your help on Skype the other day :)
And sorry for taking so long to fix it.
Cheers!
Lucoh
from simple-headless-chrome.
Related Issues (20)
- Cannot get onConsole working HOT 1
- setCookie documentation is wrong
- saveScreenshot clip param doesn't work HOT 4
- chrome-launcher not stating HOT 2
- [Question] Can I load a local html file and transform it into PDF ? HOT 1
- input selector HOT 1
- Example of getCookies and setCookie HOT 1
- Notification when a given script is loaded
- Timeout Error HOT 1
- Is there a way to use xpath to select an element
- Is there any way to set user agent? HOT 1
- Program unable to catch the error thrown by waitForPageToLoad()
- Download path
- Error: Invalid target undefined
- Outdated dependency: 1 high severity vulnerability in [email protected]
- Update the content in the PDF and/or add clickable link in the PDF runtime HOT 1
- A link containing hash "#", is not rendering correctly in printToPDF HOT 1
- How to switch between tabs?
- Can not connect with different port
- Do you support that lib?
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 simple-headless-chrome.