Prerender plugin help to blacklist and abort all css, png, font request in chrome hreadless
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
.npmignore
LICENSE
README.md
index.js
package.json

README.md

Prerender Request Blacklist

This is a plugin to be used with your Prerender server to avoid requesting to any blacklist extensions such as image, css, fonts etc

Install

npm install

npm install prerender-request-blacklist --save

server.js

const prerender = require('prerender');
const server = prerender();

server.use(require('prerender-request-blacklist'));

server.start();

Test it

curl http://localhost:3000/render?url=https://www.example.com/

Options

List of blacklist data separated by ,

export BLACKLISTED_EXTS=css,jpg export BLACKLISTED_DOMAIN=google.com export BLACKLISTED_MATCH=regex_pattern

For example:

export BLACKLISTED_EXTS=ico,jpg,jpeg,png,ttf,eot,otf,woff,woff2,gif,svg,pdf,css,svg export BLACKLISTED_DOMAIN=www.googletagmanager.com,googletagmanager.com,www.google-analytics.com,google-analytics.com,connect.facebook.net,lc.iadvize.com,fonts.gstatic.com,gstatic.com,i.ytimg.com,www.youtube.com,vimeo.com,www.vimeo.com,baidu.com,f.vimeocdn.com,fresnel.vimeocdn.com,player.vimeo.com,i.vimeocdn.com,youtube.com,player.youtube.com,stats.g.doubleclick.net,static.iadvize.com,api.iadvize.com export BLACKLISTED_MATCH=^[^ignore]+$