CheshireCaat / playwright-with-fingerprints

Anonymous automation via playwright with fingerprint replacement technology.
MIT License
139 stars 11 forks source link

Why is incognito mode broken now? #15

Closed dr3adx closed 1 year ago

dr3adx commented 1 year ago

Why remove .launch and replace it with persistent context with no option to launch in incognito mode ???

bablosoft commented 1 year ago

Because we need to know exact path of profile before launch in order to do some preparation.

dr3adx commented 1 year ago

Because we need to know exact path of profile before launch in order to do some preparation.

what preparation, is this critical?

forcing persistent session breaks a lot of playwright features like storageState this literally destroyed my program because i cant use storageState anymore

CheshireCaat commented 1 year ago

@dr3adx The developers of playwright for some reason forbade specifying the path to the profile when using the launch method a long time ago. However, with engine updates, a significant part of the new factors for improving anonymity has been added, which need to prepare the profile in some way before launch.

In the case of launch, the framework itself sets a random path somewhere in the temp folders, and we cannot find it out in advance. Therefore, it was decided to limit the functionality so that later there would be no unnecessary questions and problems with anonymity. Of course, if a good workaround or direct opportunity comes along, the launch method will work just as it did before.

In order to load cookies or local storage, use a permanent profile or the CDP commands. If you have suggestions for the implementation of alternative methods, I will be glad to listen.

I also see that there is a feautre request in the playwright repository to add storageState to launchPersistentContext, so the problem may be solved by itself a little later.

dr3adx commented 1 year ago

@dr3adx The developers of playwright for some reason forbade specifying the path to the profile when using the launch method a long time ago. However, with engine updates, a significant part of the new factors for improving anonymity has been added, which need to prepare the profile in some way before launch.

In the case of launch, the framework itself sets a random path somewhere in the temp folders, and we cannot find it out in advance. Therefore, it was decided to limit the functionality so that later there would be no unnecessary questions and problems with anonymity. Of course, if a good workaround or direct opportunity comes along, the launch method will work just as it did before.

In order to load cookies or local storage, use a permanent profile or the CDP commands. If you have suggestions for the implementation of alternative methods, I will be glad to listen.

I also see that there is a feautre request in the playwright repository to add storageState to launchPersistentContext, so the problem may be solved by itself a little later.

what anonymity problems, can you please explain this in more technical sense?

"the framework itself sets a random path somewhere in the temp folders" -- profile folder name is always a random letter string of constant length 8 characters, so why not just scan the folder, you already know inside which parent folder its gonna reside.

CheshireCaat commented 1 year ago

you already know inside which parent folder its gonna reside.

  1. OK, we will get a list of folders with profiles, we need to find out which one specifically corresponds to which browser. We still do not know in advance what kind of identifier will be generated, whether it is a constant size or not.
  2. We must set up a profile BEFORE launching, the framework generates a path to it DURING launch.
  3. We also cannot divide the launch into stages, because the framework does everything itself.

what anonymity problems, can you please explain this in more technical sense?

At a minimum, the following things cannot be used/configured without a prepared profile:

  1. Default browser extensions.
  2. Browser components.
  3. Safe browsing.
  4. Widevine.

And so on.

dr3adx commented 1 year ago

what anonymity problems, can you please explain this in more technical sense?

At a minimum, the following things cannot be used/configured without a prepared profile:

  1. Default browser extensions.
  2. Browser components.
  3. Safe browsing.
  4. Widevine.

And so on.

so nothing related to actual bot detection? thats what i wanted to ask originally