Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes carlo launches into the wrong window when using "--auto-open-devtools-for-tabs" launch arg #128

Open
gadamsgh opened this issue Jan 24, 2019 · 2 comments

Comments

@gadamsgh
Copy link

When debugging, it is useful to automatically launch devtools for the window, using the "--auto-open-devtools-for-tabs" flag.

Example main.js:

const carlo = require('carlo');

(async () => {
  const app = await carlo.launch({args:["--auto-open-devtools-for-tabs"]});
  app.on('exit', () => process.exit());
  app.serveFolder(__dirname);
  await app.load('https://www.google.com');
})();

Most of the time, google.com (site being launched in this case, happens with any site) will open in one window, and devtools will open in another window:
image

Occasionally, both windows will initialize but google.com will open in the window intended for devtools (making the devtools inaccessible), leaving the window intended for google.com in an odd state. This occurs maybe 20% of the time on my Windows 10 machine.

image

@pavelfeldman
Copy link
Collaborator

Carlo assumes it manages windows and --auto-open-devtools-for-tabs breaks that assumption I guess...

@lukehorvat
Copy link

Yep, I've been encountering the same issue on Mac.

A crude workaround:

const app = await carlo.launch({ args: ['--auto-open-devtools-for-tabs'] });
app.on('exit', () => process.exit());
app.serveFolder(__dirname);

await app.createWindow(); // create a second window
await app.mainWindow().close(); // dispose the first window
await app.load('index.html');

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

No branches or pull requests

3 participants