Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

Commit

Permalink
added userAgent
Browse files Browse the repository at this point in the history
  • Loading branch information
Flowko committed Nov 13, 2022
1 parent 053ad90 commit 45196f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ ENV NUXT_PORT 3000
ENV PASSWORD_PROTECT 0
ENV PASSWORD null
ENV RUNNING_DOCKER 1
ENV USER_AGENT "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36"

CMD [ "yarn", "start" ]
4 changes: 4 additions & 0 deletions server-middleware/website-shot.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ app.post("/screenshot", async (req, res) => {
options.launchOptions.executablePath = "/usr/bin/chromium-browser";
}

if (process.env.USER_AGENT && process.env.USER_AGENT.length > 0) {
options.userAgent = process.env.USER_AGENT;
}

const mimeType = params.mimeType;

if (urls && urls.length > 0 && params.type == "multiple-imgs") {
Expand Down

0 comments on commit 45196f9

Please sign in to comment.