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

how to close default first tab? #72

Open
cffgnu opened this issue Oct 21, 2022 · 6 comments
Open

how to close default first tab? #72

cffgnu opened this issue Oct 21, 2022 · 6 comments

Comments

@cffgnu
Copy link

cffgnu commented Oct 21, 2022

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
Copy link

6ebeng commented Oct 21, 2022

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

@cffgnu
Copy link
Author

cffgnu commented Oct 21, 2022

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

@6ebeng
Copy link

6ebeng commented Oct 21, 2022

then zero index is a first tab

@6ebeng
Copy link

6ebeng commented Oct 21, 2022

I'm using puppeteer have no issues

@cffgnu
Copy link
Author

cffgnu commented Oct 21, 2022

my example code:

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

Please explain?

@djengis
Copy link

djengis commented Dec 8, 2022

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

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