Chromedp: how to run chromedp in normal window ?

Created on 5 Jul 2019  路  3Comments  路  Source: chromedp/chromedp

i used to use this package as a testing tool for my websites
after i updated the package it now runs in headless
i don't want that
i need a normal window with the option to define the chrome user dir and the port
i used to do that with the runner options ,now it's gone
please i need a working example

question

Most helpful comment

I did it like this:

opts := append(chromedp.DefaultExecAllocatorOptions[:],chromedp.Flag("headless", false),)
actx, cancel := chromedp.NewExecAllocator(context.Background(), opts...)
ctx, cancel = chromedp.NewContext(actx)
defer cancel()

hope this helps

All 3 comments

Have you seen the very top of https://github.com/chromedp/chromedp#frequently-asked-questions?

yes i have seen it , and followed the example
but i didn't get any useful tip on how to do what i need to do
@mvdan please if you can provide me with a working example ,it will mean a lot

I did it like this:

opts := append(chromedp.DefaultExecAllocatorOptions[:],chromedp.Flag("headless", false),)
actx, cancel := chromedp.NewExecAllocator(context.Background(), opts...)
ctx, cancel = chromedp.NewContext(actx)
defer cancel()

hope this helps

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jafriyie1 picture jafriyie1  路  3Comments

mschilli picture mschilli  路  4Comments

vdobler picture vdobler  路  4Comments

aymericbeaumet picture aymericbeaumet  路  5Comments

youshy picture youshy  路  5Comments