Skip to content

Commit 4bb26f9

Browse files
authored
feat(get-html): add dashlord to user-agent (#326)
1 parent 8951cc3 commit 4bb26f9

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

.github/workflows/get-html.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,18 @@ jobs:
2121
run: |
2222
ls -la
2323
- uses: ./get-html
24+
name: test some URL
2425
with:
2526
url: https://opentermsarchive.org
2627
output: result.html
2728
- shell: bash
2829
run: |
2930
cat result.html | grep Accessibilité
31+
- uses: ./get-html
32+
name: test user-agent
33+
with:
34+
url: https://httpbin.org/user-agent
35+
output: user-agent.html
36+
- shell: bash
37+
run: |
38+
cat user-agent.html | grep dashlord

get-html/src/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ const getHTML = async (url) => {
1111
`--lang=${LANGUAGE}`,
1212
],
1313
});
14-
14+
const userAgent = await browser.userAgent();
1515
let html = "";
1616
try {
1717
const page = await browser.newPage();
18+
await page.setUserAgent(`${userAgent} - dashlord`);
1819
await page.goto(url);
1920
await page.waitForTimeout(5000); // wait some time, some SPA may load asynchronously (ex: angular)
2021
const frame = await page.mainFrame();

0 commit comments

Comments
 (0)