Skip to content

Commit ddc0348

Browse files
authored
feature: block requests to ads and tracker domains (#9)
2 parents f14adbd + f5b0908 commit ddc0348

File tree

9 files changed

+32612
-8
lines changed

9 files changed

+32612
-8
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ ADD package-lock.json /app
2929
ADD package.json /app
3030
ADD jest.config.js /app
3131
ADD tslint.json /app
32+
ADD adblock-hosts.txt /app
3233
ADD tsconfig.json /app
3334
ADD src /app/src
3435

@@ -45,6 +46,7 @@ ENV NODE_ENV production
4546

4647
COPY --from=builder /app/node_modules /app/node_modules
4748
COPY --from=builder /app/dist /app/dist
49+
COPY --from=builder /app/adblock-hosts.txt /app/adblock-hosts.txt
4850
COPY --from=builder /app/package.json /app/package.json
4951

5052
HEALTHCHECK CMD curl --fail http://localhost:3000/-/health || exit 1

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ docker run --name rendergun -p 3000:3000 goenning/rendergun
5959
| HTTP Header | x-rendergun-wait-until | `load` | No | which chrome event to wait before returning the HTML. Possible values are `load`, `domcontentloaded`, `networkidle0`,`networkidle2` |
6060
| HTTP Header | x-rendergun-timeout | `10000` | No | timeout in milliseconds for Chrome to load the page |
6161
| HTTP Header | x-rendergun-abort-request | | No | a RegExp that aborts all requests that matches it. Useful to skip requests to CSS/Images files that are not required for pre-rendering |
62+
| HTTP Header | x-rendergun-block-ads | false | No | true/false if Rendergun should skip requests to Ads/Trackers domains. This gives a small performance improvement and avoid unecessary tracking |
6263

6364
**Example:** [https://demo.fider.io](https://demo.fider.io) is a client-side rendered page built with React. Look at the source and you'll see that only JavaScript files and a JSON object is returned by the server. The whole HTML is built by React when it's executed by the browser.
6465

0 commit comments

Comments
 (0)