Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need it as a npm package #95

Closed
Kalaiarasan469 opened this issue Sep 6, 2019 · 5 comments
Closed

Need it as a npm package #95

Kalaiarasan469 opened this issue Sep 6, 2019 · 5 comments

Comments

@Kalaiarasan469
Copy link

I am trying to write a script(JS) in which I will have a website url and the script will capture the page and download it the same way the extension does in the browser.

P.S. - I am using node js.

@protecthem1
Copy link

protecthem1 commented Sep 6, 2019 via email

@mrcoles
Copy link
Owner

mrcoles commented Sep 6, 2019

Hey @Kalaiarasan469 this is a Chrome extension. There are a couple things that I’m not fully understanding from your request to make it an npm package:

  1. If it were an NPM package, then it should be a library that extracts part of this, not the whole extension
  2. Because it is a Chrome extension it is using privileged APIs that the Chrome browser exposes to the extension, e.g., chrome.tabs.executeScript, chrome.tabs.sendMessage, chrome.tabs.captureVisibleTab, so (a) it needs to run in a browser, not node and (b) it needs to run with chrome extension privileges in order to have access to those APIs

@garyking
Copy link

Use Puppeteer for this purpose, to take screenshots with Node. Google search for "capture screenshots with puppeteer".

@Kalaiarasan469
Copy link
Author

@mrcoles What you said was correct. As @garyking said I used puppeteer to do it. Thanks guys

@mrcoles
Copy link
Owner

mrcoles commented Sep 16, 2019

Cool thanks! Yeah, the real magic of the Chrome extension is that it lets you take a screenshot of what you’re currently viewing while browsing the web, so you can capture some unique state that won’t be recreated by sharing the link with someone else. Thanks for providing a suggestion @garyking !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants