Good evening everyone, I have a problem in the playwright framework when I try to open a new tab in the firefox browser, it is connected with the fact that when I initialize the firefox browser after it has made certain conditions, it needs to open a new tab and start doing the same actions but with others data, but the bottom line is when my script processes the first action and I want to open a new tab in the SAME BROWSER, INSTEAD OF OPENING A NEW TAB, A NEW BROWSER firefox opens
page = context.new_page()
And also, the imitation of mouse scrolling using a java script does not work for me:
page.evaluate('''
const scrollstep = 200; // Размер шага прокрутки (в пикселях)
const scrollInterval = 100; // Интервал между шагами (в миллисекундах)
const scrollHeight = document.documentElement.scrollHeight;
let currentPosition = 0;
const interval = setInterval(() => {
window.scrollBy(0, scrollstep);
currentPosition += scrollstep;
if (currentPosition >= scrollHeight) {
clearInterval(interval);
}
}, scrollInterval);
''')
I tried to do the same actions on another chromium browser, but everything already works there, a new tab opens and not a new browser, but the problem is that chromium has very poor speed compared to firefox, I also read their official documentation: https://playwright.dev/docs/intro but I didn't find any useful information in it