schickling/chromeless

setViewport fails when local chrome running in non-default port / host

Closed this issue · 1 comments

in the setViewport function, we're using CDP.version(), which according to chrome-remote-interface's documentation should be provided with an options object, just like CDP.New()

https://github.com/graphcool/chromeless/blob/db10706f13812a0de64ea5a15ccf9a16a4dfb8f9/src/util.ts#L27

When running the chrome debugger in a non-default localhost:9222 configuration, using setViewport fails with this error:

error:  Error: connect ECONNREFUSED 127.0.0.1:9222
    at Object.exports._errnoException (util.js:1016:11)
    at exports._exceptionWithHostPort (util.js:1039:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1138:14)

The solution is to supply the options correctly on this line

related to larger issue: #267