Skip to content
This repository has been archived by the owner on Mar 21, 2021. It is now read-only.

Can't get headless arg to work #46

Open
haydenflinner opened this issue Jul 31, 2017 · 2 comments
Open

Can't get headless arg to work #46

haydenflinner opened this issue Jul 31, 2017 · 2 comments

Comments

@haydenflinner
Copy link

Here's the code I'm trying to run, compiled from two different examples in the docs:

const { Chrome } = require('navalia');
const chrome = new Chrome({chromeOptions: {
    flags: {
      headless: false
    }
  }});
chrome
  .goto('https://amazon.com')
  .type('input', 'Kindle')
  .click('.buy-now')
  .then((responses) => {
    console.log(responses); // ['https://www.amazon.com/', true, true, true]
  });

But when I run it it works as normal, like it did before I added the noheadless arg. Anything obvious I'm doing wrong?

@joelgriffith
Copy link
Owner

D'oh! I must have it wrong someplace. For the chrome module, you don't need the chromeOptions object. Just pass a simple object with a flags property:

const chrome = new Chrome({ flags: {...} });

Do you recall where you saw this? The Navalia module uses that signature as it's not vendor specific (hence the chromeOptions)

@haydenflinner
Copy link
Author

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants