Skip to content

Commit

Permalink
fix: change url before rendering, fix #25 (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
H4M5TER authored Feb 26, 2024
1 parent 03228ae commit 2ea426c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ class Puppeteer extends Service {

render = async (content: string, callback?: RenderCallback) => {
const page = await this.page()
await page.goto(pathToFileURL(resolve(__dirname, '../index.html')).href)
if (content) await page.setContent(content)

callback ||= async (_, next) => page.$('body').then(next)
Expand Down

0 comments on commit 2ea426c

Please sign in to comment.