I am looking at cdp package and no way I can find it;)
Create a new target, create a handler from the target, and then initialise it for use:
client := cdpclient.New()
t, err := client.NewPageTarget(ctx)
if err != nil {
return err
}
h, err := cdp.NewTargetHandler(t, log.Printf, log.Printf, log.Printf)
if err != nil {
return err
}
if err := h.Run(ctx); err != nil {
return err
}
As @MrSaints has described.
Is it possible to create a new private tab?
@KristinaEtc I don't think so, but you can simply disable cookies (or rather, delete them), and disable caching. You'll get a similar behaviour to Incognito.
@MrSaints And how to interact with the "h"? How to "click" an element for instance? Thank you