You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Passing the remoteUrl option allows reusing a running Chrome instance for screenshots, but it will always close that browser at the end. Instead I would expect it to only close the tab it created, and just disconnect from the browser, so that the browser instance can be reused further.
To Reproduce
Please run this script (node chrome_server.js) in a shell with puppeteer installed to open a Chrome instance, the browserWSEndpoint URL will be printed to the terminal for you to copy-paste:
// chrome_server.jsconstpuppeteer=require('puppeteer');(async()=>{varbrowser=awaitpuppeteer.launch({headless: false,executablePath: '/usr/bin/google-chrome',// Adjust as needed or remove to use default Chrome binary.});varbrowserWSEndpoint=browser.wsEndpoint();console.log(browserWSEndpoint);browser.disconnect();})();
Then in a separate shell run timesnap against that remoteUrl like:
timesnap --remote-url <browserWSEndpoint> ...
Expected behavior
It should open a new tab in the running Chrome, do its thing, then close the tab but leave the browser opened/alive.
Describe the bug
Passing the
remoteUrl
option allows reusing a running Chrome instance for screenshots, but it will always close that browser at the end. Instead I would expect it to only close the tab it created, and just disconnect from the browser, so that the browser instance can be reused further.To Reproduce
Please run this script (
node chrome_server.js
) in a shell with puppeteer installed to open a Chrome instance, the browserWSEndpoint URL will be printed to the terminal for you to copy-paste:Then in a separate shell run timesnap against that remoteUrl like:
timesnap --remote-url <browserWSEndpoint> ...
Expected behavior
It should open a new tab in the running Chrome, do its thing, then close the tab but leave the browser opened/alive.
puppeteer.launch()
VSpuppeteer.connect()
:https://github.com/tungs/timesnap/blob/main/index.js#L115-L117
browser.close()
andbrowser.disconnect()
: https://github.com/tungs/timesnap/blob/main/index.js#L284Attachments and Screenshots
Browser is closed at the end of the timesnap call:
Desktop (please complete the following information):
A so far simple PR: #81
Please let me know what you think, thanks.
The text was updated successfully, but these errors were encountered: