All Projects → gwuhaolin → chrome-render

gwuhaolin / chrome-render

Licence: other
general server render base on headless chrome

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to chrome-render

api2pdf.php
PHP client library for the Api2Pdf.com REST API - Convert HTML to PDF, URL to PDF, Office Docs to PDF, Merge PDFs, HTML to Image, URL to Image, HTML to Docx, HTML to Xlsx, PDF to HTML, Thumbnail preview of office files
Stars: ✭ 42 (-54.35%)
Mutual labels:  headless-chrome
headless-chrome-alpine
A Docker container running headless Chrome
Stars: ✭ 26 (-71.74%)
Mutual labels:  headless-chrome
laravel-browsershot
Browsershot wrapper for Laravel 5
Stars: ✭ 108 (+17.39%)
Mutual labels:  headless-chrome
codepen-puppeteer
Use Puppeteer to download pens from Codepen.io as single html pages
Stars: ✭ 22 (-76.09%)
Mutual labels:  headless-chrome
puppeteer-autoscroll-down
Handle infinite scroll on websites by puppeteer
Stars: ✭ 40 (-56.52%)
Mutual labels:  headless-chrome
throughout
🎪 End-to-end testing made simple (using Jest and Puppeteer)
Stars: ✭ 16 (-82.61%)
Mutual labels:  headless-chrome
chrome-runner
run chrome with nodejs in code
Stars: ✭ 16 (-82.61%)
Mutual labels:  headless-chrome
generateDeviceScreenshots
A simple command line tool to generate device screenshots of different webpages.
Stars: ✭ 69 (-25%)
Mutual labels:  headless-chrome
fastify-vite
This plugin lets you load a Vite client application and set it up for Server-Side Rendering (SSR) with Fastify.
Stars: ✭ 497 (+440.22%)
Mutual labels:  server-rendering
nest-puppeteer
Puppeteer (Headless Chrome) provider for Nest.js
Stars: ✭ 68 (-26.09%)
Mutual labels:  headless-chrome
web-onefx-boilerplate
Full-stack React Framework for building web and backend
Stars: ✭ 34 (-63.04%)
Mutual labels:  server-rendering
after-work.js
[DEPRECATED] CLI for automated tests in web projects.
Stars: ✭ 56 (-39.13%)
Mutual labels:  headless-chrome
puppeteer-instagram
Instagram automation driven by headless chrome.
Stars: ✭ 87 (-5.43%)
Mutual labels:  headless-chrome
uzen
Website crawler with YARA detection
Stars: ✭ 84 (-8.7%)
Mutual labels:  headless-chrome
node-headless-chrome
⚠️ 🚧 Install precompiled versions of the Chromium/Chrome headless shell using npm or yarn
Stars: ✭ 20 (-78.26%)
Mutual labels:  headless-chrome
apify-cli
Apify command-line interface helps you create, develop, build and run Apify actors, and manage the Apify cloud platform.
Stars: ✭ 37 (-59.78%)
Mutual labels:  headless-chrome
server-render-javascript
Prerender your javascript web page for better seo with PhantomJS. ⚠️ no es6 supported.
Stars: ✭ 12 (-86.96%)
Mutual labels:  server-rendering
koa-seo
koa SEO middleware
Stars: ✭ 36 (-60.87%)
Mutual labels:  server-rendering
phantom-lord
Handy API for Headless Chromium
Stars: ✭ 24 (-73.91%)
Mutual labels:  headless-chrome
googlemeetbot
A simple Google meet bot so the bot can attend classes for you.
Stars: ✭ 54 (-41.3%)
Mutual labels:  headless-chrome

Npm Package Build Status Npm Downloads Dependency Status

chrome-render

High-performance and universal server render base on Headless chrome, render any SPA(render data in browser) in server for SEO or other optimizes.

Use

  1. install it from npm by npm i chrome-render

  2. new a ChromeRender then use it to render a web page, a ChromeRender means a chrome.

const ChromeRender = require('chrome-render');
// ChromeRender.new() return a Promise, you can use async function in this way:
// const chromeRender = await ChromeRender.new(); 
ChromeRender.new({}).then(async(chromeRender)=>{
    const htmlString = await chromeRender.render({
       url: 'http://qq.com',
    });
});    

A chromeRender instance can call render multi-times and concurrent for high frequency use case. chromeRender will manage a tabs pool to render multi-pages concurrent.

  1. After you don't need chromeRender anymore, you should call await chromeRender.destroyRender() to kill chrome add release all resource.

see more demo in unit test

API

ChromeRender.new() method support options:

  • maxTab: number max tab chrome will open to render pages, default is no limit, maxTab used to avoid open to many tab lead to chrome crash. ChromeRender will create a tab poll to reuse tab for performance improve and resource reduce as open and close tab in chrome require time, like database connection poll.
  • chromeRunnerOptions: object same as chrome-runner's options, can config chrome's startup options, detail see chrome-runner options

chromeRender.render() method support options:

  • url: string is required, web page's URL
  • cookies: object {cookieName:cookieValue} is an option param. set HTTP cookies when request web page
  • headers: object {headerName:headerValue} is an option param. add HTTP headers when request web page
  • useReady: boolean whether use window.isPageReady=1 to notify chrome-render page is ready. default is false chrome-render use domContentEventFired as page has ready.
  • script: string is an option param. inject script source to evaluate when page on load
  • renderTimeout: number in ms, render() will throw error if html string can't be resolved after renderTimeout, default is 5000ms.
  • deviceMetricsOverride: object overrides the values of device screen dimensions for responsive websites, detail use see here
  • clearTab: boolean if true after render chrome instance will navigate to about:blank to free resources. default is true. setting to false may increase page load speed when rendering the same website.

all request from chrome-render will take with a HTTP header x-chrome-render:${version}

Friends

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].