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

cant use userAction in headless mode #48

Closed mehrdad86 closed 2 years ago

mehrdad86 commented 2 years ago

I use userAction.simClickElement its ok when headless false but when I change headless to true i get this error "Ubable to get active page"

RubtsovAV commented 2 years ago

I use userAction.simClickElement its ok when headless false but when I change headless to true i get this error "Ubable to get active page"

I've faced with the same issue and here is my workaround:

    const fakebrowser = await builder.launch();
    const oldPage = await fakebrowser.getActivePage();
    const page = await fakebrowser.vanillaBrowser.newPage();
    await oldPage.close();

It happens because the chrome starts with an opened page.