Middleware to render the HTML DOM using PhantomJS for legacy browsers
npm install phantomjs-dom-rendererMiddleware to render the HTML DOM using PhantomJS for legacy browsers.
The module returns a factory which accepts a single optional options object.hijackresponse is used to transform the output of another middleware.
Therefore phantomjs-dom-renderer must be added to the route before the middleware which does the actual rendering.
Example:
``
// creates a middleware which will be active for IE8 and below
app.use(phantomjsDomRenderer({
userAgentRegExp: new RegExp('MSIE [1-8]\.')
}))
// the actual renderer must be added after phantomjs-dom-renderer!
app.use(myRenderer)
`
- userAgentRegExp: Regular expression for the User-Agent header.new RegExp('MSIE [1-9]\.')`)
Only matches will be processed.
(default: