Skip to content

Add ability to run JS scripts during archiving with Playwright/Puppeteer #51

@pirate

Description

@pirate

https://github.com/GoogleChrome/puppeteer is fantastic for scripting actions on pages before making a screenshot or PDF.

I could add support for custom puppeteer scripts for certain urls that need a user action to be performed before archiving (e.g. logging in or closing a welcome message popup).

Puppeteer code looks like this:

        const browser = await puppeteer.launch({headless: false})
        const page = await browser.newPage()

        await page.goto('https://carbon.now.sh')

        const code_input = 'div.ReactCodeMirror div.CodeMirror-code > pre:nth-child(11)'
        await page.click(code_input)
        await page.keyboard.down('Meta')
        await page.keyboard.down('a')
        await page.keyboard.up('a')
        await page.keyboard.up('Meta')
        await page.keyboard.press('Backspace')

Metadata

Metadata

Assignees

No one assigned

    Labels

    size: hardstatus: backlogWork is planned someday but is not the highest priority at the momentstatus: wipWork is in-progress / has already been partially completedtouches: data/schema/architecturewhy: functionalityIntended to improve ArchiveBox functionality or features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions