0

I am building a site that can take web page screen capture of the given URL, and then output a image URL. There have been so many services like this, but I am curious about how it works.

Initially, I guess I have to execute a browser on server-side, feed the URL given from client. The browser then load the URL, after that, wait for a few seconds for executing javascript because some pages cost time to perform its UI, like Trello. In the end, call certain API to capture that page.

I made up my mind to using the open source browser, Chromium. Even so, I still have doubt about if I am doing the right thing.

Questions

  1. Does my direction right?
  2. I am wondering how to execute a long-live Chromium browser on my server.
  3. Is there a shell I can control Chromium in command line?
Weihang Jian
  • 7,826
  • 4
  • 44
  • 55

1 Answers1

1

Chrome has a built in API that may meet your needs "captureVisibleTab":

chrome.tabs.captureVisibleTab(integer windowId, object options, function callback)

Captures the visible area of the currently active tab in the specified window. You must have host permission for the URL displayed by the tab.

http://developer.chrome.com/trunk/extensions/tabs.html#method-captureVisibleTab

Community
  • 1
  • 1
igrigorik
  • 9,433
  • 2
  • 29
  • 30