Skip to content

Commit

Permalink
chore(html): animations disabled by default (#467)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Jun 3, 2023
1 parent b976152 commit e4242d5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/browserless/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ module.exports = ({ timeout: globalTimeout = 30000, ...launchOpts } = {}) => {
browser: getBrowser,
evaluate,
goto,
html: evaluate(page => page.content(), { animations: true }),
html: evaluate(page => page.content()),
page: createPage,
pdf: withPage(createPdf({ goto })),
screenshot: withPage(createScreenshot({ goto })),
Expand Down
10 changes: 9 additions & 1 deletion packages/browserless/test/snapshots/index.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@ Generated by [AVA](https://avajs.dev).
<meta charset="UTF-8">␊
<meta name="viewport" content="width=device-width, initial-scale=1.0">␊
<title>Document</title>␊
</head>␊
<style>*,␊
::before,␊
::after {␊
animation-delay: 0s !important;␊
transition-delay: 0s !important;␊
animation-duration: 0s !important;␊
transition-duration: 0s !important;␊
transition-property: none !important;␊
}</style></head>␊
<body>␊
<p>hello world</p>␊
Expand Down
Binary file modified packages/browserless/test/snapshots/index.js.snap
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module.exports = (browser, teardown = browser.close) => {
test('.html', async t => {
const browserless = await browser.createContext()
t.teardown(browserless.destroyContext)
const html = await browserless.html(serverUrl, { adblock: false, animations: true })
const html = await browserless.html(serverUrl, { adblock: false })
t.snapshot(html)
})

Expand Down

0 comments on commit e4242d5

Please sign in to comment.