Chromeless: How to accept a confirm box?

Created on 27 Jul 2017  路  3Comments  路  Source: prisma-archive/chromeless

I'm trying to accept a (browser-native) confirm box. My current try is as follows, but does not seem to do anything:

// Clicking the button to trigger the box. This is successful,
// the JS event triggers and window.confirm gets called
await chromeless.click('#button')

// No confirm box shown :(
await chromeless.screenshot()

// Still no confirm box shown :(
await chromeless.wait(1000)
await chromeless.screenshot()

// Trying to press enter?
await chromeless.press(13)

// Still no confirm box, and not accepted either, JS event did not trigger
await chromeless.screenshot()

Is there something I am missing here?


Edit: Chromium 59.0.3071.109 Built on Ubuntu, running on Ubuntu 16.04

API feature

Most helpful comment

How about using evaluate to overwrite window.confirm temporarily?

chromeless.evaluate(() => window.confirm = () => true)

All 3 comments

This seems definitely like a case that needs investigation. Would you even consider creating a PR for this?

I would be up for putting some time in - we use confirm boxes fairly frequently - but I'd need some pointers on where to start.

How about using evaluate to overwrite window.confirm temporarily?

chromeless.evaluate(() => window.confirm = () => true)
Was this page helpful?
0 / 5 - 0 ratings

Related issues

wmdmark picture wmdmark  路  5Comments

georgejor picture georgejor  路  5Comments

seangransee picture seangransee  路  5Comments

ovheurdrive picture ovheurdrive  路  5Comments

mafshin picture mafshin  路  6Comments