kkoooqq / fakebrowser

🤖 Fake fingerprints to bypass anti-bot systems. Simulate mouse and keyboard operations to make behavior like a real person.
GNU Lesser General Public License v3.0
1.13k stars 211 forks source link

how to close default first tab? #72

Open cffgnu opened 1 year ago

cffgnu commented 1 year ago

this library open 2 tab. tab 1: default , tab 2 by: await fakeBrowser.vanillaBrowser.newPage(). i want to remove default puppeteer tab. how to ?

6ebeng commented 1 year ago

use this const page = (await fakeBrowser.vanillaBrowser.pages())[0] to select default page tab

cffgnu commented 1 year ago

sory, it not working because (await fakeBrowser.vanillaBrowser.pages()).length return zero.

6ebeng commented 1 year ago

then zero index is a first tab

6ebeng commented 1 year ago

I'm using puppeteer have no issues

cffgnu commented 1 year ago

my example code:

let fakeBrowser = await builder.launch();
var pages = await fakeBrowser.vanillaBrowser.pages();
console.log(pages.length==0); //true

Please explain?

djengis commented 1 year ago

Can confirm. await fakeBrowser.vanillaBrowser.pages(); returns an empty array.